-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-37121][docs] Fix syntax and examples in create table statement doc #25982
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,15 +149,15 @@ Flink SQL> INSERT INTO RubberOrders SELECT product, amount FROM Orders WHERE pro | |
## CREATE TABLE | ||
|
||
```text | ||
CREATE TABLE [IF NOT EXISTS] [catalog_name.][db_name.]table_name | ||
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [catalog_name.][db_name.]table_name | ||
( | ||
{ <physical_column_definition> | <metadata_column_definition> | <computed_column_definition> }[ , ...n] | ||
[ <watermark_definition> ] | ||
[ <table_constraint> ][ , ...n] | ||
) | ||
[COMMENT table_comment] | ||
[PARTITIONED BY (partition_column_name1, partition_column_name2, ...)] | ||
[ <distribution> ] | ||
[PARTITIONED BY (partition_column_name1, partition_column_name2, ...)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why has this line been moved? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I try to parse a sql which |
||
WITH (key1=val1, key2=val2, ...) | ||
[ LIKE source_table [( <like_options> )] | AS select_query ] | ||
|
||
|
@@ -198,6 +198,18 @@ CREATE TABLE [IF NOT EXISTS] [catalog_name.][db_name.]table_name | |
|
||
根据指定的表名创建一个表,如果同名表已经在 catalog 中存在了,则无法注册。 | ||
|
||
有关 CREATE MATERIALIZED TABLE 语法请查看 [Materialized Table Statements]({{< ref "docs/dev/table/materialized-table/statements" >}}). | ||
|
||
**TEMPORARY** | ||
|
||
临时表通常保存于内存中并且仅在创建它们的 Flink 会话持续期间存在。 | ||
|
||
更多信息请查看 [Temporary vs Permanent tables]({{< ref "docs/dev/table/common" >}}#temporary-vs-permanent-tables). | ||
|
||
**IF NOT EXISTS** | ||
|
||
若该表已经存在,则不会进行任何操作。 | ||
|
||
### Columns | ||
|
||
**Physical / Regular Columns** | ||
|
@@ -288,7 +300,7 @@ CREATE TABLE MyTable ( | |
`timestamp` BIGINT METADATA, -- part of the query-to-sink schema | ||
`offset` BIGINT METADATA VIRTUAL, -- not part of the query-to-sink schema | ||
`user_id` BIGINT, | ||
`name` STRING, | ||
`name` STRING | ||
) WITH ( | ||
'connector' = 'kafka' | ||
... | ||
|
@@ -594,7 +606,7 @@ CREATE TABLE my_ctas_table ( | |
desc STRING, | ||
quantity DOUBLE, | ||
cost AS price * quantity, | ||
WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND, | ||
WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND | ||
) WITH ( | ||
'connector' = 'kafka', | ||
... | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should include MATERIALIZED as well like this [TEMPORARY | MATERIALIZED ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CREATE MATERIALIZED TABLE statement cannot have column definitions, and MATERIALIZED TABLE has a separate page for description, so I think this page is to create a normal table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiefei30 that makes sense - though it is strange to have 2 create table grammars described. I suggest some text to link to the materialized table grammar would be useful. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidradl I agree. I will add some text to link to the materialized table grammar and temporary table description