Supported Type | Source and Sink |
Running Mode | Stream, Batch |
API Type | SQL |
Write Mode | append / upsert |
Flink Version | Whether Supported | Paimon Community Version |
1.13 | Not supported. | - |
1.14 | Not supported. | - |
1.16 | Supported | 0.9 |
1.18 | Supported | 0.9 |
1.20 | Supported | 1.4 |
CREATE CATALOG my_catalog WITH ('type' = 'paimon','warehouse' = 'hdfs://HDFS14979/usr/hive/warehouse');
CREATE CATALOG my_hive WITH ('type' = 'paimon','metastore' = 'hive',-- 'uri' = 'thrift://<hive-metastore-host-name>:<port>', -- Uses the 'hive.metastore.uris' in HiveConf by default.-- 'warehouse' = 'hdfs://HDFS14979/usr/hive/warehouse', -- Uses the 'hive.metastore.warehouse.dir' in HiveConf by default.);
-- Create a primary key tableCREATE TABLE my_table (user_id BIGINT,item_id BIGINT,behavior STRING,dt STRING,hh STRING,PRIMARY KEY (dt, hh, user_id) NOT ENFORCED) WITH ('bucket' = '10',-- Other with parameters);-- Create a partitioned tableCREATE TABLE my_table (user_id BIGINT,item_id BIGINT,behavior STRING,dt STRING,hh STRING,PRIMARY KEY (dt, hh, user_id) NOT ENFORCED) PARTITIONED BY (dt, hh) WITH ('bucket' = '10',-- Other with parameters);
Parameter | Data Type | Required | Default Value | Description |
bucket | Integer | No | -1 | The number of buckets for a Paimon table. Available values are as follows: -1: Dynamic bucketing mode Greater than 0: Fixed bucketing mode |
bucket-key | String | No | None | Specifies the column(s) used for data bucketing. Data is distributed to each bucket based on the hash value of the bucket key. If multiple fields are specified, separate them with commas. If not specified, the primary key is used. If there is no primary key, the entire row is used. |
changelog-producer | Enum | No | none | changelog generation mechanism. Available values are as follows: none: Does not generate a changelog. input: Duplicates the input data stream into changelog files, which serve as the changelog. full-compaction: Generates a changelog each time a full compaction is performed. lookup: Generates a changelog through the lookup method. |
merge-engine | Enum | No | deduplicate | The merge mechanism for data with the same primary key. Available values are as follows: deduplicate: Deduplicates and retains the last row. partial-update: Partially updates non-null fields. aggregation: Aggregates fields that share the same primary key. first-row: Deduplicates and retains the first row. |
snapshot.num-retained.max | Integer | No | 2147483647 | The maximum number of the latest Snapshots to retain without expiration. Must be greater than or equal to snapshot.num-retained.min. |
snapshot.num-retained.min | Integer | No | 10 | The minimum number of the latest Snapshots to retain without expiration. Must be greater than or equal to 1. |
snapshot.time-retained | Duration | No | 1h | The duration after which a Snapshot expires. |
-- Create a logger sinkCREATE TABLE logger_sink (id BIGINT,name STRING) WITH ('connector' = 'logger','print-identifier' = 'DebugData');-- Create a paimon catalogCREATE CATALOG paimon_catalog WITH ('type' = 'paimon','warehouse' = 'hdfs://HDFS14979/usr/hive/warehouse');-- Read data from paimon and write it to a logger sinkINSERT INTO logger_sinkSELECT * FROM paimon_catalog.test_db.user_info;
-- Create a datagen sourceCREATE TABLE datagen_source (id BIGINT,name STRING) WITH ('connector' = 'datagen','rows-per-second' = '10');-- Create a paimon catalogCREATE CATALOG paimon_catalog WITH ('type' = 'paimon','warehouse' = 'hdfs://HDFS14979/usr/hive/warehouse');-- Create a paimon database and table (skip if they already exist)CREATE DATABASE IF NOT EXISTS paimon_catalog.test_db;CREATE TABLE IF NOT EXISTS paimon_catalog.test_db.user_info (id BIGINT,name STRING,PRIMARY KEY (id) NOT ENFORCED) WITH ('bucket' = '2');-- Generate data with datagen and write it to a paimon tableINSERT INTO paimon_catalog.test_db.user_infoSELECT * FROM datagen_source;


containerized.taskmanager.env.HADOOP_USER_NAME: hadoopcontainerized.master.env.HADOOP_USER_NAME: hadoop
/usr/local/service/hadoop/etc/hadoop/hdfs-site.xml
jar -cvf hdfs-xxx.jar hdfs-site.xml
vi hdfs-xxx.jar
META-INF/META-INF/MANIFEST.MFhdfs-site.xml
containerized.taskmanager.env.HADOOP_USER_NAME: hadoopcontainerized.master.env.HADOOP_USER_NAME: hadoop
/usr/local/service/hive/conf/hive-site.xml/usr/local/service/hadoop/etc/hadoop/hdfs-site.xml
Add the following configuration to hive-site.xml. Set the value for 'ip' to the value of 'hive.server2.thrift.bind.host' in the configuration file.<property><name>hive.metastore.uris</name><value>thrift://ip:7004</value></property>
jar -cvf hive-xxx.jar hive-site.xml hdfs-site.xml hivemetastore-site.xml hiveserver2-site.xml
vi hive-xxx.jar). The jar file includes the following information. Make sure no file is missing and the structure is correct.META-INF/META-INF/MANIFEST.MFhive-site.xmlhdfs-site.xmlhivemetastore-site.xmlhiveserver2-site.xml
/etc/krb5.conf/var/krb5kdc/emr.keytab/usr/local/service/hadoop/etc/hadoop/core-site.xml/usr/local/service/hadoop/etc/hadoop/hdfs-site.xml/usr/local/service/hive/conf/hive-site.xml
hive.server2.thrift.bind.host in the configuration file.<property><name>hive.metastore.uris</name><value>thrift://ip:7004</value></property>
jar cvf hive-xxx.jar krb5.conf emr.keytab core-site.xml hdfs-site.xml hive-site.xml hivemetastore-site.xml hiveserver2-site.xml
META-INF/META-INF/MANIFEST.MFemr.keytabkrb5.confhdfs-site.xmlcore-site.xmlhive-site.xmlhivemetastore-site.xmlhiveserver2-site.xml
klist -kt /var/krb5kdc/emr.keytab# The output is as follows. Select the first one: hadoop/172.28.28.51@EMR-OQPO48B9KVNO Timestamp Principal---- ------------------- ------------------------------------------------------2 08/09/2021 15:34:40 hadoop/172.28.28.51@EMR-OQPO48B92 08/09/2021 15:34:40 HTTP/172.28.28.51@EMR-OQPO48B92 08/09/2021 15:34:40 hadoop/VM-28-51-centos@EMR-OQPO48B92 08/09/2021 15:34:40 HTTP/VM-28-51-centos@EMR-OQPO48B9
containerized.taskmanager.env.HADOOP_USER_NAME: hadoopcontainerized.master.env.HADOOP_USER_NAME: hadoopsecurity.kerberos.login.principal: hadoop/172.28.28.51@EMR-OQPO48B9security.kerberos.login.keytab: emr.keytabsecurity.kerberos.login.conf: krb5.conf
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback