Back to Clickhouse

paimon

docs/en/sql-reference/table-functions/paimon.md

26.4.1.1-new3.6 KB
Original Source

import ExperimentalBadge from '@theme/badges/ExperimentalBadge';

paimon Table Function {#paimon-table-function}

<ExperimentalBadge />

Provides a read-only table-like interface to Apache Paimon tables in Amazon S3, Azure, HDFS or locally stored.

Syntax {#syntax}

sql
paimon(url [,access_key_id, secret_access_key] [,format] [,structure] [,compression] [,extra_credentials])

paimonS3(url [,access_key_id, secret_access_key] [,format] [,structure] [,compression] [,extra_credentials])

paimonAzure(connection_string|storage_account_url, container_name, blobpath, [,account_name], [,account_key] [,format] [,compression_method])

paimonHDFS(path_to_table, [,format] [,compression_method])

paimonLocal(path_to_table, [,format] [,compression_method])

Arguments {#arguments}

Description of the arguments coincides with description of arguments in table functions s3, azureBlobStorage, HDFS and file correspondingly. format stands for the format of data files in the Paimon table.

For paimonS3, an optional extra_credentials parameter can be used to pass a role_arn for role-based access in ClickHouse Cloud. See Secure S3 for configuration steps.

Returned value {#returned-value}

A table with the specified structure for reading data in the specified Paimon table.

Defining a named collection {#defining-a-named-collection}

Here is an example of configuring a named collection for storing the URL and credentials:

xml
<clickhouse>
    <named_collections>
        <paimon_conf>
            <url>http://test.s3.amazonaws.com/clickhouse-bucket/</url>
            <access_key_id>test<access_key_id>
            <secret_access_key>test</secret_access_key>
            <format>auto</format>
            <structure>auto</structure>
        </paimon_conf>
    </named_collections>
</clickhouse>
sql
SELECT * FROM paimonS3(paimon_conf, filename = 'test_table')
DESCRIBE paimonS3(paimon_conf, filename = 'test_table')

Aliases {#aliases}

Table function paimon is an alias to paimonS3 now.

Virtual Columns {#virtual-columns}

  • _path — Path to the file. Type: LowCardinality(String).
  • _file — Name of the file. Type: LowCardinality(String).
  • _size — Size of the file in bytes. Type: Nullable(UInt64). If the file size is unknown, the value is NULL.
  • _time — Last modified time of the file. Type: Nullable(DateTime). If the time is unknown, the value is NULL.
  • _etag — The etag of the file. Type: LowCardinality(String). If the etag is unknown, the value is NULL.

Data Types supported {#data-types-supported}

Paimon Data TypeClickhouse Data Type
BOOLEANInt8
TINYINTInt8
SMALLINTInt16
INTEGERInt32
BIGINTInt64
FLOATFloat32
DOUBLEFloat64
STRING,VARCHAR,BYTES,VARBINARYString
DATEDate
TIME(p),TIMETime('UTC')
TIMESTAMP(p) WITH LOCAL TIME ZONEDateTime64
TIMESTAMP(p)DateTime64('UTC')
CHARFixedString(1)
BINARY(n)FixedString(n)
DECIMAL(P,S)Decimal(P,S)
ARRAYArray
MAPMap

Partition supported {#partition-supported}

Data types supported in Paimon partition keys:

  • CHAR
  • VARCHAR
  • BOOLEAN
  • DECIMAL
  • TINYINT
  • SMALLINT
  • INTEGER
  • DATE
  • TIME
  • TIMESTAMP
  • TIMESTAMP WITH LOCAL TIME ZONE
  • BIGINT
  • FLOAT
  • DOUBLE

See Also {#see-also}