Skip to content

[core] jdbc catalog: make warehouse path optional#8111

Draft
nickdelnano wants to merge 4 commits into
apache:masterfrom
nickdelnano:nickdelnano/jdbc-cross-warehouse-resolution
Draft

[core] jdbc catalog: make warehouse path optional#8111
nickdelnano wants to merge 4 commits into
apache:masterfrom
nickdelnano:nickdelnano/jdbc-cross-warehouse-resolution

Conversation

@nickdelnano
Copy link
Copy Markdown
Contributor

@nickdelnano nickdelnano commented Jun 3, 2026

Purpose

My platform based on Paimon has many tables across many warehouses. This requires users to have many CREATE CATALOG statements with many warehouse values. This is inconvenient and I'd like to simplify the platform usage. Jdbc catalog already has information that can be used to derive location, so warehouse can become optional.

The primary use case is to infer table locations in the read path. It will also work in the write path if the database already exists in jdbc catalog.

Summary

Make warehouse path optional for jdbc catalog. Table location is resolved in the order of:

  1. Custom table path in paimon_table_properties (from [core] Support custom table paths in JdbcCatalog #7475)
  2. Warehouse-computed path if warehouse is set (existing behavior, backwards compatible)
  3. Database location from paimon_database_properties (only reached when warehouse is null)

Built on top of #7475 (custom table path support for JDBC catalog)

Tests

Unit tests

tub and others added 3 commits June 3, 2026 15:07
Enable users to specify custom storage locations for individual tables
via CoreOptions.PATH, replicating the pattern already used by HiveCatalog.
The catalog-level warehouse becomes a default, but individual tables can
live at arbitrary paths persisted in paimon_table_properties.

Key changes:
- JdbcUtils: add getTableProperty() to fetch a single table property
- JdbcCatalog: override allowCustomTablePath(), getTableLocation()
- createTableImpl: use initialTableLocation(), store path for custom tables
- dropTableImpl: skip filesystem deletion for custom-path tables
- renameTableImpl: skip filesystem rename for custom-path tables
- alterTableImpl: preserve custom path across property refresh
- dropDatabaseImpl/repairTable: always manage table properties

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Custom table path support is now only available when
syncTableProperties is enabled, preserving the existing default
behavior when sync is off.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Consolidate getTableLocation + isCustomTablePath into a single
  fetchStoredPathIfSyncEnabled call in dropTableImpl and renameTableImpl
- Document that repairTable cannot recover custom-path tables when
  all JDBC metadata is lost
- Fix stale "Hive Metastore" comment in renameTableImpl

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nickdelnano nickdelnano changed the title [core] Resolve JDBC catalog table locations from database properties [core] warehouse path optional for jdbc catalog use cases Jun 3, 2026
@nickdelnano nickdelnano changed the title [core] warehouse path optional for jdbc catalog use cases [core] jdbc catalog: make warehouse path optional Jun 4, 2026
@nickdelnano nickdelnano force-pushed the nickdelnano/jdbc-cross-warehouse-resolution branch 2 times, most recently from f3e8ecb to 677b7f7 Compare June 4, 2026 00:31
@nickdelnano nickdelnano force-pushed the nickdelnano/jdbc-cross-warehouse-resolution branch from 677b7f7 to 5f11dbf Compare June 4, 2026 01:06
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