Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a8e5f53
catalog: add pg_foreign_catalog, pg_foreign_volume, pg_lake_table
MisterRaindrop Jul 2, 2026
c2bb7c0
nodes: add parse nodes for Iceberg lake-table DDL
MisterRaindrop Jul 2, 2026
b028fb8
parser: add grammar for CREATE ICEBERG TABLE / FOREIGN CATALOG / VOLUME
MisterRaindrop Jul 2, 2026
5a679b2
commands: implement CREATE/DROP FOREIGN CATALOG and FOREIGN VOLUME
MisterRaindrop Jul 2, 2026
b4704be
commands: implement CREATE ICEBERG TABLE
MisterRaindrop Jul 2, 2026
a81bd6b
bin: pg_dump skip and psql tab completion for lake-table DDL
MisterRaindrop Jul 2, 2026
73172e8
tests: add lake_table regression test, refresh catalog expecteds
MisterRaindrop Jul 2, 2026
5be5f9f
Use ASF license header for new lake-table source files
MisterRaindrop Jul 6, 2026
272d910
Move ASF license header to top of file header block
MisterRaindrop Jul 6, 2026
c70fbf9
foreigncmds: flatten IF NOT EXISTS duplicate handling
MisterRaindrop Jul 7, 2026
5105d02
parser/commands: unify lake-table DROP syntax with CREATE
MisterRaindrop Jul 10, 2026
f21763c
commands: make foreign catalog type a required first-class column
MisterRaindrop Jul 10, 2026
7e6e7ca
Update src/backend/foreign/foreign.c
MisterRaindrop Jul 10, 2026
70b451a
Update src/include/commands/laketablecmds.h
MisterRaindrop Jul 10, 2026
32bda14
psql: complete only iceberg tables for DROP ICEBERG TABLE
MisterRaindrop Jul 10, 2026
f6d3286
commands: finish ValidateLakeTableOptions -> ValidateLakeTableStmt re…
MisterRaindrop Jul 10, 2026
afe4142
commands: reject plain DROP TABLE on an iceberg table
MisterRaindrop Jul 14, 2026
9e4e0c2
doc: add reference pages for the iceberg lake-table DDL commands
MisterRaindrop Jul 14, 2026
199a027
parser/commands: switch lake-table DDL to CREATE LAKE TABLE ... USING…
MisterRaindrop Jul 20, 2026
710af2c
laketablecmds: case-normalize the USING format; use base_path in the …
MisterRaindrop Jul 20, 2026
20a2d00
commands: slim pg_lake_table to the catalog/volume binding; reject DI…
MisterRaindrop Jul 22, 2026
3d31515
Merge branch 'main' of https://github.com/apache/cloudberry into feat…
MisterRaindrop Jul 22, 2026
a8b0627
parser: drop the DISTRIBUTED clause from the CREATE LAKE TABLE grammar
MisterRaindrop Jul 22, 2026
445cd16
laketablecmds: identify lake tables by pg_lake_table membership; vali…
MisterRaindrop Jul 22, 2026
6924020
laketablecmds: use the format name in the missing access-method hint
MisterRaindrop Jul 22, 2026
f4ac7dd
tests/commands: check pg_lake_table cleanup by saved OID; tidy the SE…
MisterRaindrop Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
laketablecmds: case-normalize the USING format; use base_path in the …
…volume example

- gram.y: lower-case the USING format for the access method name (it was only
  upper-cased for table_type), so a quoted "ICEBERG" / "IceBerg" resolves the
  iceberg AM instead of failing late with "access method ... does not exist".
- regress: add a quoted mixed-case format case to lock this in; rename the
  volume path option in the example from `path` to `base_path` to match the
  agreed name (discussion #1683).  Volume options are free-form (no validator),
  so this is example-only.
- create_foreign_volume.sgml: same base_path example.
  • Loading branch information
MisterRaindrop committed Jul 20, 2026
commit 710af2c58d4a6d761232fa3a29bb778dd96b799a
2 changes: 1 addition & 1 deletion doc/src/sgml/ref/create_foreign_volume.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ CREATE FOREIGN VOLUME [ IF NOT EXISTS ] <replaceable class="parameter">volume_na
Create a volume for an object storage prefix using the foreign server
<literal>s3_srv</literal>:
<programlisting>
CREATE FOREIGN VOLUME s3_vol SERVER s3_srv OPTIONS (path 's3://bucket/prefix');
CREATE FOREIGN VOLUME s3_vol SERVER s3_srv OPTIONS (base_path 's3://bucket/prefix');
</programlisting></para>
</refsect1>

Expand Down
22 changes: 20 additions & 2 deletions src/backend/parser/gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -9188,10 +9188,19 @@ CreateLakeTableStmt:
{
CreateLakeTableStmt *n = makeNode(CreateLakeTableStmt);
char *table_type = pstrdup($9);
char *access_method = pstrdup($9);
char *p;

/*
* The USING format is case-insensitive: upper-case it for
* the stored table_type and lower-case it for the access
* method name, so a quoted "ICEBERG" resolves the same AM
* as an unquoted iceberg.
*/
for (p = table_type; *p; p++)
*p = pg_toupper((unsigned char) *p);
for (p = access_method; *p; p++)
*p = pg_tolower((unsigned char) *p);

$4->relpersistence = RELPERSISTENCE_PERMANENT;
n->base.relation = $4;
Expand All @@ -9202,7 +9211,7 @@ CreateLakeTableStmt:
n->base.options = NIL;
n->base.oncommit = ONCOMMIT_NOOP;
n->base.tablespacename = NULL;
n->base.accessMethod = $9;
n->base.accessMethod = access_method;
n->base.if_not_exists = false;
n->base.relKind = RELKIND_RELATION;
n->table_type = table_type;
Expand All @@ -9226,10 +9235,19 @@ CreateLakeTableStmt:
{
CreateLakeTableStmt *n = makeNode(CreateLakeTableStmt);
char *table_type = pstrdup($12);
char *access_method = pstrdup($12);
char *p;

/*
* The USING format is case-insensitive: upper-case it for
* the stored table_type and lower-case it for the access
* method name, so a quoted "ICEBERG" resolves the same AM
* as an unquoted iceberg.
*/
for (p = table_type; *p; p++)
*p = pg_toupper((unsigned char) *p);
for (p = access_method; *p; p++)
*p = pg_tolower((unsigned char) *p);

$7->relpersistence = RELPERSISTENCE_PERMANENT;
n->base.relation = $7;
Expand All @@ -9240,7 +9258,7 @@ CreateLakeTableStmt:
n->base.options = NIL;
n->base.oncommit = ONCOMMIT_NOOP;
n->base.tablespacename = NULL;
n->base.accessMethod = $12;
n->base.accessMethod = access_method;
n->base.if_not_exists = true;
n->base.relKind = RELKIND_RELATION;
n->table_type = table_type;
Expand Down
10 changes: 5 additions & 5 deletions src/test/regress/expected/lake_table.out
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ SELECT fcname, fctype, fcoptions FROM pg_foreign_catalog WHERE fcname LIKE 'lake
(1 row)

-- CREATE FOREIGN VOLUME
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv OPTIONS (path 's3://bucket/prefix');
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv OPTIONS (base_path 's3://bucket/prefix');
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv; -- fail, duplicate
ERROR: foreign volume "lake_test_vol" already exists
CREATE FOREIGN VOLUME IF NOT EXISTS lake_test_vol SERVER lake_test_srv; -- skip with notice
Expand All @@ -82,9 +82,9 @@ NOTICE: foreign volume "lake_test_vol" already exists, skipping
CREATE FOREIGN VOLUME lake_test_bad SERVER no_such_server; -- fail, no server
ERROR: server "no_such_server" does not exist
SELECT fvname, fvoptions FROM pg_foreign_volume WHERE fvname LIKE 'lake\_test%';
fvname | fvoptions
---------------+---------------------------
lake_test_vol | {path=s3://bucket/prefix}
fvname | fvoptions
---------------+--------------------------------
lake_test_vol | {base_path=s3://bucket/prefix}
(1 row)

-- Object descriptions
Expand Down Expand Up @@ -203,7 +203,7 @@ SELECT policytype, distkey FROM gp_distribution_policy WHERE localoid = 'lake_te
CREATE LAKE TABLE lake_test_bad0 (a int) USING heap CATALOG lake_test_cat VOLUME lake_test_vol; -- fail, unsupported format
ERROR: unsupported lake table format "HEAP"
HINT: The only supported format is ICEBERG (USING ICEBERG).
CREATE LAKE TABLE lake_test_t4 (a int) USING iceberg CATALOG lake_test_cat VOLUME lake_test_vol; -- lower-case format is fine
CREATE LAKE TABLE lake_test_t4 (a int) USING "IceBerg" CATALOG lake_test_cat VOLUME lake_test_vol; -- quoted mixed-case format resolves the iceberg AM
-- The iceberg AM is rejected for every path other than CREATE LAKE TABLE
CREATE TABLE lake_test_bad1 (a int) USING iceberg DISTRIBUTED RANDOMLY; -- fail
ERROR: cannot create table "lake_test_bad1" with access method "iceberg"
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/sql/lake_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE FOREIGN CATALOG lake_test_bad SERVER no_such_server TYPE 'hive'; -- fail
SELECT fcname, fctype, fcoptions FROM pg_foreign_catalog WHERE fcname LIKE 'lake\_test%';

-- CREATE FOREIGN VOLUME
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv OPTIONS (path 's3://bucket/prefix');
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv OPTIONS (base_path 's3://bucket/prefix');
CREATE FOREIGN VOLUME lake_test_vol SERVER lake_test_srv; -- fail, duplicate
CREATE FOREIGN VOLUME IF NOT EXISTS lake_test_vol SERVER lake_test_srv; -- skip with notice
-- volume names are global: the same name on another server is still a duplicate
Expand Down Expand Up @@ -92,7 +92,7 @@ SELECT policytype, distkey FROM gp_distribution_policy WHERE localoid = 'lake_te

-- The USING clause names the table format; only ICEBERG is supported (any case)
CREATE LAKE TABLE lake_test_bad0 (a int) USING heap CATALOG lake_test_cat VOLUME lake_test_vol; -- fail, unsupported format
CREATE LAKE TABLE lake_test_t4 (a int) USING iceberg CATALOG lake_test_cat VOLUME lake_test_vol; -- lower-case format is fine
CREATE LAKE TABLE lake_test_t4 (a int) USING "IceBerg" CATALOG lake_test_cat VOLUME lake_test_vol; -- quoted mixed-case format resolves the iceberg AM

-- The iceberg AM is rejected for every path other than CREATE LAKE TABLE
CREATE TABLE lake_test_bad1 (a int) USING iceberg DISTRIBUTED RANDOMLY; -- fail
Expand Down
Loading