Skip to content

feat(catalog): add SQL catalog#693

Merged
wgtmac merged 4 commits into
apache:mainfrom
zhjwpku:sql_catalog
Jun 5, 2026
Merged

feat(catalog): add SQL catalog#693
wgtmac merged 4 commits into
apache:mainfrom
zhjwpku:sql_catalog

Conversation

@zhjwpku
Copy link
Copy Markdown
Collaborator

@zhjwpku zhjwpku commented May 31, 2026

Add a relational database backed SqlCatalog with a CatalogStore abstraction, built-in sqlpp23 stores for SQLite, PostgreSQL, and MySQL, and Java-compatible catalog tables.

zhjwpku added 2 commits June 1, 2026 01:33
Add a relational database backed SqlCatalog with a CatalogStore
abstraction, built-in sqlpp23 stores for SQLite, PostgreSQL, and
MySQL, and Java-compatible catalog tables.
@zhjwpku zhjwpku changed the title feat(sql): add SQL catalog feat: add SQL catalog Jun 1, 2026
Comment thread .github/workflows/test.yml Outdated
shell: pwsh
run: |
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows sqlite3:x64-windows
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 it better to add a dedicated ci workflow for the sql catalog? We can trigger it only when files related to sql catalog have been changed to reduce resource usage.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I've added a dedicated CI workflow, but I haven't configured paths filtering for SQL catalog-related changes yet. Since it's a bit tricky to define a clean filter, I'd rather address that in a separate PR.

Comment thread CMakeLists.txt Outdated
option(ICEBERG_BUILD_REST "Build rest catalog client" ON)
option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF)
option(ICEBERG_BUILD_HIVE "Build hive (HMS) catalog client" OFF)
option(ICEBERG_BUILD_SQL_CATALOG "Build SQL catalog client" ON)
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.

Should we make it off by default? This follows the pattern used by rest catalog library.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

REST catalog is ON by default, but I'd agree that we should make SQL catalog OFF, changed.

Comment thread src/iceberg/catalog/sql/README.md
Comment thread src/iceberg/catalog/sql/sql_catalog.h Outdated
const TableIdentifier& identifier,
const std::string& metadata_file_location) override;

#ifdef BUILD_SQLITE3_CONNECTOR
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.

Would it be good to always make these functions visible to users? We can check BUILD_SQLITE3_CONNECTOR and other macros in the sql_catalog.cc file and return NotSupported if not built.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, done that way.

@zhjwpku zhjwpku requested a review from wgtmac June 5, 2026 00:53
Copy link
Copy Markdown
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

Thank you for adding this, @zhjwpku! I think this is a great enrichment to iceberg-cpp and its downstream users. I'll count on you to maintain this module in the future.

mkdir build && cd build
cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DICEBERG_BUILD_SQL_CATALOG=ON \
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.

It would be nice to enhance this in the future by enabling specific modules only when their paths are affected.

@wgtmac wgtmac changed the title feat: add SQL catalog feat(catalog): add SQL catalog Jun 5, 2026
@wgtmac wgtmac merged commit 24cbe84 into apache:main Jun 5, 2026
19 checks passed
@zhjwpku zhjwpku deleted the sql_catalog branch June 5, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants