Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 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
5af075e
Revert the kernel-side lake-table DDL scaffolding
MisterRaindrop Aug 13, 2026
b671a35
datalake_fdw: Apache Iceberg lake tables as an extension (skeleton)
MisterRaindrop Jul 31, 2026
c624a99
interconnect: restart in fast mode so the test does not race crash re…
MisterRaindrop Aug 5, 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
4 changes: 4 additions & 0 deletions .github/workflows/build-cloudberry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ jobs:
"contrib/pg_buffercache:installcheck",
"contrib/sslinfo:installcheck"]
},
{"test":"ic-datalake-fdw",
"make_configs":["contrib/datalake_fdw:installcheck"],
"shared_preload_libraries":"datalake_fdw"
},
{"test":"ic-gpcontrib",
"make_configs":["gpcontrib/orafce:installcheck",
"gpcontrib/zstd:installcheck",
Expand Down
1 change: 1 addition & 0 deletions contrib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SUBDIRS = \
btree_gin \
btree_gist \
citext \
datalake_fdw \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is datalake_fdw enabled by default? We can disable it by default and enable it using the --enable-datalake_fdw configure option, the way like PAX.

dblink \
dict_int \
dict_xsyn \
Expand Down
8 changes: 8 additions & 0 deletions contrib/datalake_fdw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

# Generated from exports.txt at build time
/exports.map
/exports_darwin.list
109 changes: 109 additions & 0 deletions contrib/datalake_fdw/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# contrib/datalake_fdw/Makefile

MODULE_big = datalake_fdw
EXTENSION = datalake_fdw
DATA = datalake_fdw--1.0.sql

OBJS = \
src/am_iceberg/pg_iceberg_am_handler.o \
src/am_iceberg/pg_iceberg_extensible.o \
src/am_iceberg/pg_iceberg_ddl.o \
src/am_iceberg/pg_iceberg_options.o \
src/am_iceberg/pg_iceberg_guc.o \
src/am_iceberg/pg_iceberg_reject.o \
src/iceberg_catalog_fdw/iceberg_catalog_fdw.o \
src/iceberg_catalog_fdw/iceberg_catalog_option.o \
src/iceberg_volume_fdw/iceberg_volume_fdw.o \
src/iceberg_volume_fdw/iceberg_volume_option.o \
src/meta/meta_engine_registry.o \
src/meta/meta_engine_init.o \
src/meta/engine_stub/stub_engine.o \
src/format/format_registry.o \
src/common/dl_err.o \
src/common/dl_option_util.o \
src/common/parser_option.o \
src/common/file_system_wrapper.o \
src/common/s3_file_system.o \
src/common/backend_registry.o

# Use the documented PGXS knobs: pgxs.mk appends these AFTER the flags configure
# chose, so optimization/warning settings survive. A pre-include
# "override CFLAGS +=" would give CFLAGS override origin and silently discard
# Makefile.global's own "CFLAGS = @CFLAGS@" assignment.
PG_CFLAGS = -fvisibility=hidden
PG_CXXFLAGS = -fvisibility=hidden -fvisibility-inlines-hidden -std=c++17
PG_CPPFLAGS = -I$(srcdir)/src

# The regression cases live with the rest of the test material rather than in a
# second place of their own; pg_regress is pointed at them. REGRESS_OPTS is
# expanded after the --inputdir that Makefile.global supplies, so this wins.
#
# _PG_init refuses to run outside shared_preload_libraries, so any server used
# to test this module has to be started with it. For an in-tree "make check"
# that is what the temp-config supplies. For "make installcheck" -- which is
# what CI runs, against a cluster created with the library already preloaded --
# pg_regress ignores it. Note that "make check" exists in-tree only; under PGXS
# pgxs.mk refuses the target outright.
REGRESS = iceberg_am_ddl iceberg_am_reject iceberg_am_acl
REGRESS_OPTS = --temp-config=$(srcdir)/datalake_fdw.conf \
--inputdir=$(srcdir)/test/automation/sqlrepo/smoke/iceberg_am

EXTRA_CLEAN = exports_darwin.list exports.map

# Keep the aggregate target as make's default goal.
all:

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/datalake_fdw
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

# Everything below needs variables that Makefile.global defines (PORTNAME), and
# SHLIB_LINK additions still apply because the link recipe expands it when it
# runs.

# Shared libraries are linked with $(CC) (see src/Makefile.shlib COMPILER), so a
# module containing C++ translation units must pull in the C++ runtime itself.
SHLIB_LINK += -lstdc++

# Arrow and other C++ dependencies land in this module later; the export list is
# the single place that decides what stays visible, so the mechanism ships now.
ifeq ($(PORTNAME), darwin)
EXPORT_LIST = exports_darwin.list
SHLIB_LINK += -Wl,-exported_symbols_list,exports_darwin.list

exports_darwin.list: exports.txt
sed -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*$$/d' -e 's/^/_/' $< > $@
else
EXPORT_LIST = exports.map
SHLIB_LINK += -Wl,--version-script=exports.map -Wl,--exclude-libs,ALL

exports.map: exports.txt
{ echo '{ global:'; sed -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*$$/d' -e 's/$$/;/' $<; echo 'local: *; };'; } > $@
endif

all: $(EXPORT_LIST)
$(shlib): $(EXPORT_LIST)
40 changes: 40 additions & 0 deletions contrib/datalake_fdw/datalake_fdw--1.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* contrib/datalake_fdw/datalake_fdw--1.0.sql
*/

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION datalake_fdw" to load this file. \quit

CREATE FUNCTION iceberg_am_handler(internal)
RETURNS table_am_handler AS 'MODULE_PATHNAME' LANGUAGE C;

CREATE ACCESS METHOD iceberg TYPE TABLE HANDLER iceberg_am_handler;

CREATE FUNCTION iceberg_catalog_fdw_validator(text[], oid)
RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C STRICT;

CREATE FOREIGN DATA WRAPPER iceberg_catalog_fdw
VALIDATOR iceberg_catalog_fdw_validator;

CREATE FUNCTION iceberg_volume_fdw_validator(text[], oid)
RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C STRICT;

CREATE FOREIGN DATA WRAPPER iceberg_volume_fdw
VALIDATOR iceberg_volume_fdw_validator;
25 changes: 25 additions & 0 deletions contrib/datalake_fdw/datalake_fdw.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# contrib/datalake_fdw/datalake_fdw.conf
#
# Configuration for the temporary server that "make check" starts. The module
# installs process-wide hooks, so _PG_init refuses to run outside
# shared_preload_libraries; without this the first statement that reaches the
# access method would fail to load the library instead of testing it.

shared_preload_libraries = 'datalake_fdw'
23 changes: 23 additions & 0 deletions contrib/datalake_fdw/datalake_fdw.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# contrib/datalake_fdw/datalake_fdw.control

comment = 'Apache Iceberg lake tables for Cloudberry (demo skeleton)'
default_version = '1.0'
module_pathname = '$libdir/datalake_fdw'
relocatable = false
32 changes: 32 additions & 0 deletions contrib/datalake_fdw/exports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# contrib/datalake_fdw/exports.txt
#
# Single source of truth for exported symbols; the linker script for each
# platform is generated from it at build time. Adding a line here is an API
# decision, so it is one a reviewer has to see. Comment lines are stripped
# when the script is generated.

_PG_init
Pg_magic_func
pg_finfo_iceberg_am_handler
iceberg_am_handler
pg_finfo_iceberg_catalog_fdw_validator
iceberg_catalog_fdw_validator
pg_finfo_iceberg_volume_fdw_validator
iceberg_volume_fdw_validator
Loading
Loading