andr-sokolov commented on code in PR #1842:
URL: https://github.com/apache/cloudberry/pull/1842#discussion_r3620230198
##########
src/test/regress/expected/lake_table.out:
##########
@@ -0,0 +1,318 @@
+--
+-- Test lake table DDL: FOREIGN CATALOG, FOREIGN VOLUME, LAKE TABLE
+--
+-- Display the lake table catalogs
+\d+ pg_foreign_catalog
+ Table "pg_catalog.pg_foreign_catalog"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target
| Description
+-----------+--------+-----------+----------+---------+----------+--------------+-------------
+ oid | oid | | not null | | plain |
|
+ fcname | name | | not null | | plain |
|
+ fcowner | oid | | not null | | plain |
|
+ fcserver | oid | | not null | | plain |
|
+ fctype | text | C | not null | | extended |
|
+ fcoptions | text[] | C | | | extended |
|
+Indexes:
+ "pg_foreign_catalog_oid_index" PRIMARY KEY, btree (oid)
+ "pg_foreign_catalog_name_index" UNIQUE CONSTRAINT, btree (fcname)
+
+\d+ pg_foreign_volume
+ Table "pg_catalog.pg_foreign_volume"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target
| Description
+-----------+--------+-----------+----------+---------+----------+--------------+-------------
+ oid | oid | | not null | | plain |
|
+ fvname | name | | not null | | plain |
|
+ fvowner | oid | | not null | | plain |
|
+ fvserver | oid | | not null | | plain |
|
+ fvoptions | text[] | C | | | extended |
|
+Indexes:
+ "pg_foreign_volume_oid_index" PRIMARY KEY, btree (oid)
+ "pg_foreign_volume_name_index" UNIQUE CONSTRAINT, btree (fvname)
+
+\d+ pg_lake_table
+ Table "pg_catalog.pg_lake_table"
+ Column | Type | Collation | Nullable | Default | Storage |
Stats target | Description
+-------------------+--------+-----------+----------+---------+----------+--------------+-------------
+ ltrelid | oid | | not null | | plain |
|
+ ltforeign_catalog | oid | | not null | | plain |
|
+ ltforeign_volume | oid | | not null | | plain |
|
+ lttable_type | text | C | | | extended |
|
+ ltoptions | text[] | C | | | extended |
|
Review Comment:
Can we use `pg_class.relam` instead of `lttable_type` and
`pg_class.reloptions` instead of `ltoptions`?
When a lake table is created, `lttable_type` contains the same string as
`amname` does but in upper case, and the `reloptions` column is unused.
```
postgres=# CREATE LAKE TABLE lake_test_t1 (a int, b text) USING ICEBERG
CATALOG lake_test_cat VOLUME lake_test_vol OPTIONS (fileformat 'parquet');
CREATE LAKE TABLE
postgres=# select lttable_type, ltoptions from pg_lake_table;
lttable_type | ltoptions
--------------+----------------------
ICEBERG | {fileformat=parquet}
(1 row)
postgres=# select amname, reloptions from pg_class, pg_am where
relname='lake_test_t1' and relam=pg_am.oid;
amname | reloptions
---------+------------
iceberg |
(1 row)
postgres=#
```
--
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]