CREATE TABLE `setats_cdc_source` (`id` STRING,`dt` STRING,`name` STRING,`address` STRING,PRIMARY KEY (`id`, `dt`) NOT ENFORCED) WITH ('connector' = 'setats-cdc','warehouse' = 'cosn://<bucket>/warehouse','catalog-type' = 'hive','catalog-name' = 'setats','catalog-database' = 'testdb','catalog-table' = 'demo_setats_table1','uri' = 'thrift://<metastore-host-1>:7004,thrift://<metastore-host-2>:7004','manager-url' = '<Manager Url>','bucket.discovery-interval' = '30s','startup.mode' = 'earliest');
Parameter | Required | Description | Default Value |
connector | Yes | Fixed as setats. | (Not provided, must be specified) |
manager-url | Yes | Setats Manager address | (Not provided, must be specified) |
warehouse | Yes | Setats Warehouse path | (Not provided, must be specified) |
catalog-type | Yes | Catalog type, commonly Hive or Hadoop. | (Not provided, must be specified) |
catalog-name | Yes | Catalog name | (Not provided, must be specified) |
catalog-database | Yes | Database name. | default |
catalog-table | Yes | Target table name, which must match the actual table name. | None |
uri | Required for Hive catalog. | Hive metastore address | (Not provided, must be specified for Hive catalog) |
bucket | Yes | Number of buckets for the target table. It is recommended to configure this based on data volume and concurrent write capability. | (Not provided, must be specified) |
bucket-key | Yes | Bucket key, which determines which bucket the data is written to. It is recommended to select a field with relatively uniform distribution and stability. Typically, the primary key field or a subset of the primary key can be used. | Primary key by default. It is recommended to explicitly set a suitable business field as the bucket-key. |
bucket.discovery-interval | No | Dynamically detect newly added BucketShadingGroups. | 300s |
startup.mode | No | latest: read from the latest. earliest: read from the earliest. from-timestamp: read from a specified timestamp. Scan.timestamp-millis: the millisecond timestamp of the startup time in the "timestamp" startup mode. | latest |
scan.timestamp-millis | No | In the scan.timestamp-millis mode, set the startup timestamp. Example: 1767196800000. | None |
-- Create a Setats CDC source tableCREATE TABLE `demo_setats_table1` (`id` STRING,`dt` STRING,`name` STRING,`address` STRING,PRIMARY KEY (`id`, `dt`) NOT ENFORCED) WITH ('connector' = 'setats-cdc','warehouse' = 'cosn://<bucket>/warehouse','catalog-name' = 'setats','catalog-type' = 'hive','uri' = 'thrift://<metastore-host-1>:7004,thrift://<metastore-host-2>:7004','catalog-database' = 'testdb','catalog-table' = 'demo_setats_table1','manager-url' = '<Manager Url>','bucket.discovery-interval' = '30s','startup.mode' = 'earliest');-- Create a debug Sink tableCREATE TABLE `logger_sink_table` (`id` STRING,`dt` STRING,`name` STRING,`address` STRING) WITH ('connector' = 'logger','all-changelog-mode' = 'true','print-identifier' = 'DebugData');-- Perform CDC readingINSERT INTO `logger_sink_table`SELECT `id`, `dt`, `name`, `address`FROM `demo_setats_table1`;
피드백