From 673b634eb636b82efe5b758aa1537e253cb8cfa4 Mon Sep 17 00:00:00 2001 From: liliwei Date: Sun, 5 Sep 2021 15:32:24 +0800 Subject: [PATCH 1/3] Doc:Add escape in the SQL statement in the flink engine document --- site/docs/flink.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/site/docs/flink.md b/site/docs/flink.md index da48161ad540..f7eae7bed795 100644 --- a/site/docs/flink.md +++ b/site/docs/flink.md @@ -270,7 +270,7 @@ USE iceberg_db; ### `CREATE TABLE` ```sql -CREATE TABLE hive_catalog.default.sample ( +CREATE TABLE hive_catalog.`default`.sample ( id BIGINT COMMENT 'unique id', data STRING ); @@ -289,7 +289,7 @@ Currently, it does not support computed column, primary key and watermark defini To create a partition table, use `PARTITIONED BY`: ```sql -CREATE TABLE hive_catalog.default.sample ( +CREATE TABLE hive_catalog.`default`.sample ( id BIGINT COMMENT 'unique id', data STRING ) PARTITIONED BY (data); @@ -302,12 +302,12 @@ Apache Iceberg support hidden partition but apache flink don't support partition To create a table with the same schema, partitioning, and table properties as another table, use `CREATE TABLE LIKE`. ```sql -CREATE TABLE hive_catalog.default.sample ( +CREATE TABLE hive_catalog.`default`.sample ( id BIGINT COMMENT 'unique id', data STRING ); -CREATE TABLE hive_catalog.default.sample_like LIKE hive_catalog.default.sample; +CREATE TABLE hive_catalog.`default`.sample_like LIKE hive_catalog.`default`.sample; ``` For more details, refer to the [Flink `CREATE TABLE` documentation](https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table). @@ -318,13 +318,13 @@ For more details, refer to the [Flink `CREATE TABLE` documentation](https://ci.a Iceberg only support altering table properties in flink 1.11 now. ```sql -ALTER TABLE hive_catalog.default.sample SET ('write.format.default'='avro') +ALTER TABLE hive_catalog.`default`.sample SET ('write.format.default'='avro') ``` ### `ALTER TABLE .. RENAME TO` ```sql -ALTER TABLE hive_catalog.default.sample RENAME TO hive_catalog.default.new_sample; +ALTER TABLE hive_catalog.`default`.sample RENAME TO hive_catalog.`default`.new_sample; ``` ### `DROP TABLE` @@ -332,7 +332,7 @@ ALTER TABLE hive_catalog.default.sample RENAME TO hive_catalog.default.new_sampl To delete a table, run: ```sql -DROP TABLE hive_catalog.default.sample; +DROP TABLE hive_catalog.`default`.sample; ``` ## Querying with SQL @@ -389,8 +389,8 @@ Iceberg support both `INSERT INTO` and `INSERT OVERWRITE` in flink 1.11 now. To append new data to a table with a flink streaming job, use `INSERT INTO`: ```sql -INSERT INTO hive_catalog.default.sample VALUES (1, 'a'); -INSERT INTO hive_catalog.default.sample SELECT id, data from other_kafka_table; +INSERT INTO hive_catalog.`default`.sample VALUES (1, 'a'); +INSERT INTO hive_catalog.`default`.sample SELECT id, data from other_kafka_table; ``` ### `INSERT OVERWRITE` @@ -406,7 +406,7 @@ INSERT OVERWRITE sample VALUES (1, 'a'); Iceberg also support overwriting given partitions by the `select` values: ```sql -INSERT OVERWRITE hive_catalog.default.sample PARTITION(data='a') SELECT 6; +INSERT OVERWRITE hive_catalog.`default`.sample PARTITION(data='a') SELECT 6; ``` For a partitioned iceberg table, when all the partition columns are set a value in `PARTITION` clause, it is inserting into a static partition, otherwise if partial partition columns (prefix part of all partition columns) are set a value in `PARTITION` clause, it is writing the query result into a dynamic partition. From 7649c36d623f3862c457e60f6c621a20888bce38 Mon Sep 17 00:00:00 2001 From: liliwei Date: Mon, 6 Sep 2021 19:35:29 +0800 Subject: [PATCH 2/3] Doc:Add escape in the SQL statement in the flink engine document --- site/docs/flink.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/site/docs/flink.md b/site/docs/flink.md index f7eae7bed795..1ce227fb21ec 100644 --- a/site/docs/flink.md +++ b/site/docs/flink.md @@ -270,7 +270,7 @@ USE iceberg_db; ### `CREATE TABLE` ```sql -CREATE TABLE hive_catalog.`default`.sample ( +CREATE TABLE `hive_catalog`.`default`.`sample` ( id BIGINT COMMENT 'unique id', data STRING ); @@ -289,7 +289,7 @@ Currently, it does not support computed column, primary key and watermark defini To create a partition table, use `PARTITIONED BY`: ```sql -CREATE TABLE hive_catalog.`default`.sample ( +CREATE TABLE `hive_catalog`.`default`.`sample` ( id BIGINT COMMENT 'unique id', data STRING ) PARTITIONED BY (data); @@ -302,7 +302,7 @@ Apache Iceberg support hidden partition but apache flink don't support partition To create a table with the same schema, partitioning, and table properties as another table, use `CREATE TABLE LIKE`. ```sql -CREATE TABLE hive_catalog.`default`.sample ( +CREATE TABLE `hive_catalog`.`default`.`sample` ( id BIGINT COMMENT 'unique id', data STRING ); @@ -318,13 +318,13 @@ For more details, refer to the [Flink `CREATE TABLE` documentation](https://ci.a Iceberg only support altering table properties in flink 1.11 now. ```sql -ALTER TABLE hive_catalog.`default`.sample SET ('write.format.default'='avro') +ALTER TABLE `hive_catalog`.`default`.`sample` SET ('write.format.default'='avro') ``` ### `ALTER TABLE .. RENAME TO` ```sql -ALTER TABLE hive_catalog.`default`.sample RENAME TO hive_catalog.`default`.new_sample; +ALTER TABLE `hive_catalog`.`default`.`sample` RENAME TO `hive_catalog`.`default`.`new_sample`; ``` ### `DROP TABLE` @@ -332,7 +332,7 @@ ALTER TABLE hive_catalog.`default`.sample RENAME TO hive_catalog.`default`.new_s To delete a table, run: ```sql -DROP TABLE hive_catalog.`default`.sample; +DROP TABLE `hive_catalog`.`default`.`sample`; ``` ## Querying with SQL @@ -389,8 +389,8 @@ Iceberg support both `INSERT INTO` and `INSERT OVERWRITE` in flink 1.11 now. To append new data to a table with a flink streaming job, use `INSERT INTO`: ```sql -INSERT INTO hive_catalog.`default`.sample VALUES (1, 'a'); -INSERT INTO hive_catalog.`default`.sample SELECT id, data from other_kafka_table; +INSERT INTO `hive_catalog`.`default`.`sample` VALUES (1, 'a'); +INSERT INTO `hive_catalog`.`default`.`sample` SELECT id, data from other_kafka_table; ``` ### `INSERT OVERWRITE` @@ -406,7 +406,7 @@ INSERT OVERWRITE sample VALUES (1, 'a'); Iceberg also support overwriting given partitions by the `select` values: ```sql -INSERT OVERWRITE hive_catalog.`default`.sample PARTITION(data='a') SELECT 6; +INSERT OVERWRITE `hive_catalog`.`default`.`sample` PARTITION(data='a') SELECT 6; ``` For a partitioned iceberg table, when all the partition columns are set a value in `PARTITION` clause, it is inserting into a static partition, otherwise if partial partition columns (prefix part of all partition columns) are set a value in `PARTITION` clause, it is writing the query result into a dynamic partition. From 9a08400a2e0a674f96b944beaac51b3c5d5f1495 Mon Sep 17 00:00:00 2001 From: liliwei Date: Mon, 6 Sep 2021 19:41:53 +0800 Subject: [PATCH 3/3] Doc:Add escape in the SQL statement in the flink engine document --- site/docs/flink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/flink.md b/site/docs/flink.md index 1ce227fb21ec..cd4dd78429fe 100644 --- a/site/docs/flink.md +++ b/site/docs/flink.md @@ -307,7 +307,7 @@ CREATE TABLE `hive_catalog`.`default`.`sample` ( data STRING ); -CREATE TABLE hive_catalog.`default`.sample_like LIKE hive_catalog.`default`.sample; +CREATE TABLE `hive_catalog`.`default`.`sample_like` LIKE `hive_catalog`.`default`.`sample`; ``` For more details, refer to the [Flink `CREATE TABLE` documentation](https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table).