andr-sokolov commented on code in PR #1842:
URL: https://github.com/apache/cloudberry/pull/1842#discussion_r3628201792
##########
src/backend/parser/gram.y:
##########
@@ -9093,6 +9098,185 @@ CreateDirectoryTableStmt:
}
;
+/*****************************************************************************
+ *
+ * QUERY:
+ * CREATE FOREIGN CATALOG name SERVER server_name OPTIONS (...)
+ *
+ *****************************************************************************/
+
+CreateForeignCatalogStmt:
+ CREATE FOREIGN CATALOG_P name SERVER name TYPE_P Sconst
create_generic_options
+ {
+ CreateForeignCatalogStmt *n =
makeNode(CreateForeignCatalogStmt);
+ n->catalogname = $4;
+ n->servername = $6;
+ n->catalogtype = $8;
+ n->options = $9;
+ n->if_not_exists = false;
+ $$ = (Node *) n;
+ }
+ | CREATE FOREIGN CATALOG_P IF_P NOT EXISTS name SERVER
name TYPE_P Sconst create_generic_options
+ {
+ CreateForeignCatalogStmt *n =
makeNode(CreateForeignCatalogStmt);
+ n->catalogname = $7;
+ n->servername = $9;
+ n->catalogtype = $11;
+ n->options = $12;
+ n->if_not_exists = true;
+ $$ = (Node *) n;
+ }
+ ;
+
+/*****************************************************************************
+ *
+ * QUERY:
+ * CREATE FOREIGN VOLUME name SERVER server_name OPTIONS (...)
+ *
+ *****************************************************************************/
+
+CreateForeignVolumeStmt:
+ CREATE FOREIGN VOLUME name SERVER name
create_generic_options
+ {
+ CreateForeignVolumeStmt *n =
makeNode(CreateForeignVolumeStmt);
+ n->volumename = $4;
+ n->servername = $6;
+ n->options = $7;
+ n->if_not_exists = false;
+ $$ = (Node *) n;
+ }
+ | CREATE FOREIGN VOLUME IF_P NOT EXISTS name SERVER
name create_generic_options
+ {
+ CreateForeignVolumeStmt *n =
makeNode(CreateForeignVolumeStmt);
+ n->volumename = $7;
+ n->servername = $9;
+ n->options = $10;
+ n->if_not_exists = true;
+ $$ = (Node *) n;
+ }
+ ;
+
+OptForeignCatalog:
+ CATALOG_P name
{ $$ = $2; }
+ | /*EMPTY*/
{ $$ = NULL; }
+ ;
+
+OptForeignVolume:
+ VOLUME name
{ $$ = $2; }
+ | /*EMPTY*/
{ $$ = NULL; }
+ ;
+
+/*****************************************************************************
+ *
+ * QUERY:
+ * CREATE LAKE TABLE relname (columns) USING format
+ * [CATALOG cat] [VOLUME vol] OPTIONS (...)
+ *
+ * A lake table stores its data on external object storage; fragments are
+ * not hash-distributed across segments, so the distribution policy is
+ * forced to RANDOM to keep UPDATE/DELETE correct. The USING clause names
+ * the table format (currently only ICEBERG); the format also determines the
+ * table access method the relation is created with.
+ *
+ *****************************************************************************/
+
+CreateLakeTableStmt:
+ CREATE LAKE TABLE qualified_name '('
OptTableElementList ')'
+ USING name
+ OptForeignCatalog OptForeignVolume
create_generic_options
+ OptDistributedBy
Review Comment:
I suggest to remove this line because DISTRIBUTED clause is not supported
for lake tables
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]