-
Notifications
You must be signed in to change notification settings - Fork 233
Feature: Apache Iceberg lake tables as an extension (datalake_fdw skeleton) #1842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MisterRaindrop
wants to merge
29
commits into
apache:main
Choose a base branch
from
MisterRaindrop:feature/iceberg-ddl-kernel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,384
−2
Open
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 c2bb7c0
nodes: add parse nodes for Iceberg lake-table DDL
MisterRaindrop b028fb8
parser: add grammar for CREATE ICEBERG TABLE / FOREIGN CATALOG / VOLUME
MisterRaindrop 5a679b2
commands: implement CREATE/DROP FOREIGN CATALOG and FOREIGN VOLUME
MisterRaindrop b4704be
commands: implement CREATE ICEBERG TABLE
MisterRaindrop a81bd6b
bin: pg_dump skip and psql tab completion for lake-table DDL
MisterRaindrop 73172e8
tests: add lake_table regression test, refresh catalog expecteds
MisterRaindrop 5be5f9f
Use ASF license header for new lake-table source files
MisterRaindrop 272d910
Move ASF license header to top of file header block
MisterRaindrop c70fbf9
foreigncmds: flatten IF NOT EXISTS duplicate handling
MisterRaindrop 5105d02
parser/commands: unify lake-table DROP syntax with CREATE
MisterRaindrop f21763c
commands: make foreign catalog type a required first-class column
MisterRaindrop 7e6e7ca
Update src/backend/foreign/foreign.c
MisterRaindrop 70b451a
Update src/include/commands/laketablecmds.h
MisterRaindrop 32bda14
psql: complete only iceberg tables for DROP ICEBERG TABLE
MisterRaindrop f6d3286
commands: finish ValidateLakeTableOptions -> ValidateLakeTableStmt re…
MisterRaindrop afe4142
commands: reject plain DROP TABLE on an iceberg table
MisterRaindrop 9e4e0c2
doc: add reference pages for the iceberg lake-table DDL commands
MisterRaindrop 199a027
parser/commands: switch lake-table DDL to CREATE LAKE TABLE ... USING…
MisterRaindrop 710af2c
laketablecmds: case-normalize the USING format; use base_path in the …
MisterRaindrop 20a2d00
commands: slim pg_lake_table to the catalog/volume binding; reject DI…
MisterRaindrop 3d31515
Merge branch 'main' of https://github.com/apache/cloudberry into feat…
MisterRaindrop a8b0627
parser: drop the DISTRIBUTED clause from the CREATE LAKE TABLE grammar
MisterRaindrop 445cd16
laketablecmds: identify lake tables by pg_lake_table membership; vali…
MisterRaindrop 6924020
laketablecmds: use the format name in the missing access-method hint
MisterRaindrop f4ac7dd
tests/commands: check pg_lake_table cleanup by saved OID; tidy the SE…
MisterRaindrop 5af075e
Revert the kernel-side lake-table DDL scaffolding
MisterRaindrop b671a35
datalake_fdw: Apache Iceberg lake tables as an extension (skeleton)
MisterRaindrop c624a99
interconnect: restart in fast mode so the test does not race crash re…
MisterRaindrop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ SUBDIRS = \ | |
| btree_gin \ | ||
| btree_gist \ | ||
| citext \ | ||
| datalake_fdw \ | ||
| dblink \ | ||
| dict_int \ | ||
| dict_xsyn \ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
datalake_fdwenabled by default? We can disable it by default and enable it using the--enable-datalake_fdwconfigure option, the way like PAX.