spena commented on code in PR #24993:
URL: https://github.com/apache/flink/pull/24993#discussion_r1672522012
##########
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTableAs.java:
##########
@@ -124,18 +124,6 @@ public void validate() throws SqlValidateException {
getParserPosition(),
"CREATE TABLE AS SELECT syntax does not support to create
temporary table yet.");
}
-
- if (getDistribution() != null) {
- throw new SqlValidateException(
- getParserPosition(),
- "CREATE TABLE AS SELECT syntax does not support creating
distributed tables yet.");
- }
- // TODO flink dialect supports dynamic partition
Review Comment:
It's not supported in CTAS. The only allowed syntax after the schema is:
`"CREATE TABLE tbl1 PARTITION (f0) AS SELECT f0, f1 from src;`
```
org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered
"PARTITION" at line 1, column 51.
Was expecting one of:
<EOF>
"AS" ...
"LIKE" ...
"WITH" ...
"COMMENT" ...
"DISTRIBUTED" ...
"PARTITIONED" ...
```
I also tried doing the same in the `PARTITIONED BY (f0='1')`, but got
parsing errors. I also think CTAS should not supported it, so we're good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]