-- 创建表CREATETABLEword ( lines STRING )WITH('connector'='kafka','topic'='word','properties.bootstrap.servers'='master:9092,node1:9092,node2:9092','properties.group.id'='testGroup','scan.startup.mode'='earliest-offset',-- 读取所有的数据'format'='csv','csv.field-delimiter'='\t')-...
1.1.1 CREATE TABLE CREATE TABLE [catalog_name.][db_name.]table_name ( { <column_definition> | <computed_column_definition> }[ , ...n] [ <watermark_definition> ] ) [COMMENT table_comment] [PARTITIONED BY (partition_column_name1, partition_column_name2, ...)] WITH (key1=val1, ke...
1.4.Create Table With 子句 先看一个案例: 代码语言:javascript 复制 CREATETABLEKafkaTable(`user_id`BIGINT,`item_id`BIGINT,`behavior`STRING,`ts`TIMESTAMP(3)METADATAFROM'timestamp')WITH('connector'='kafka','topic'='user_behavior','properties.bootstrap.servers'='localhost:9092','properties.group...
注意:在CREATE TABLE语句中,创建主键会修改列的 nullable 属性,主键声明的列默认都是非 Nullable 的。 PARTITIONED BY 根据指定的列对已经创建的表进行分区。若表使用filesystem sink,则将会为每个分区创建一个目录。 WITH Options 表属性用于创建 table source/sink ,一般用于寻找和创建底层的连接器。 表达式key1=...
build(); TableEnvironment tableEnv = TableEnvironment.create(settings); // 创建输入表 String sourceSql = "CREATE TABLE datagen_table (\n" + " word STRING,\n" + " frequency int\n" + ") WITH (\n" + " 'connector' = 'datagen',\n" + " 'rows-per-second' = '1',\n" + " '...
CREATETABLEmq_sink ( idINTEGER, lenBIGINT, contentVARCHAR)WITH('connector'='mq5','endpoint'='<yourEndpoint>','topic'='<yourTopicName>','producerGroup'='<yourGroupName>'); RocketMQ 4.x CREATETABLEmq_sink ( idINTEGER, lenBIGINT, contentVARCHAR)WITH('connector'='mq','endpoint'='<your...
中使用 CDAS(Change Data Capture for Apache Flink)语法时,可以在源表的创建语句中使用 WITH 子句...
CREATE TABLEmyUserTable ( user_idSTRING, user_nameSTRING uv BIGINT, pv BIGINT, PRIMARY KEY (user_id) NOTENFORCED ) WITH( 'connector' = 'elasticsearch-7', 'hosts' = 'http://localhost:9200', 'index' = 'users'); 官网链接:https://ci.apache.org/projects/flink/flink-docs-release-1.11...
有关OceanBase CDC WITH 选项的详细信息,请参见OceanBase CDC Connector。 创建MySQL CDC 表 在Flink SQL CLI 中创建 MySQL 数据库对应的表。创建ob_tbl1_and_tbl2表,用来将同步的数据写入 MySQL 数据库中。 Flink SQL> CREATE TABLE ob_tbl1_and_tbl2( col1 INT PRIMARY KEY, col2 INT,col3 VARCHAR(20...
CREATE TABLE sink_table ( dim STRING, pv BIGINT, sum_price BIGINT, max_price BIGINT, min_price BIGINT, uv BIGINT, window_start bigint ) WITH ( 'connector' = 'print' ) -- 数据处理逻辑 insert into sink_table select dim, count(*) as pv, ...