Repository navigation
Fix HDFS storage type parsing in data lake catalogs - #112468
PedroTadim merged 14 commits into
Conversation
|
Workflow [PR], commit [8332f77] Summary: ✅
AI ReviewSummary
Missing context / blind spots
Final VerdictStatus: ✅ Approve — no outstanding code-review findings; required CI must complete successfully before merge. |
312a535 to
89a3f8d
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 8/8 (100.00%) · Uncovered code |
|
Dear @scanhex12, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
653fc80 to
f0002dd
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes10 object files changed (+25.12 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units109 translation units recompiled, 823 s compile time in total, 109 of them have a recent master baseline. |
eb49004 to
979ea11
Compare
|
🕵️ @SaadIMC With the database setting Could you leave HDFS out of the stateful path, for example with |
|
Thank you for the review @PedroTadim
|
A catalog vends no storage credentials for an `hdfs://` table location, and HDFS authenticates through the server's `hdfs` configuration instead. With the default `vended_credentials = 1` and a single database engine argument, resolving such a table still threw BAD_ARGUMENTS. Skip that check for HDFS, and add an integration test that resolves an HDFS-located table through a REST catalog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`SHOW CREATE TABLE` reports a catalog table's engine as `Iceberg`, and `DESCRIBE` loads the table's metadata file from storage. Start HDFS, write the metadata the catalog advertises to its location, and read the (empty) table through the catalog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
HDFS is read with the server's own identity, so a catalog table on HDFS must need the same source grant as reading it through `icebergHDFS`. Check it, filtered on the table location, before building or returning a cached storage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bles The read grant checked at table resolution is not enough for INSERT, ALTER, mutations, OPTIMIZE, EXECUTE or a data-deleting DROP, which also write with the server's HDFS identity. Check WRITE ON HDFS, filtered on the table location, at each of these entry points and in checkInsertIsAllowed, which also covers the initiator of an asynchronous insert. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both the read check in DatabaseDataLake and the write check in StorageObjectStorage now call checkCatalogHDFSAccess, which owns the grant rule and the location normalization. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Writes reach HDFS through many entrypoints (INSERT and its cluster variant, ALTER, mutations, OPTIMIZE ... MANIFEST, DROP), and checking WRITE ON HDFS at each of them kept missing some. Instead, give HDFSObjectStorage a read_only setting that rejects writes and removals, and turn it on for HDFS tables of a data lake catalog. The READ ON HDFS check at table resolution stays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test runner cannot resolve the namenode hostname; connect the same way the hdfs_api helpers do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With allow_experimental_iceberg_compaction a catalog table becomes stateful and runs background compaction, which cannot write to the read-only HDFS storage and would keep failing with READONLY. Co-Authored-By: Claude Opus 5.5 <[email protected]>
icebergHDFS checks READ ON HDFS against the HDFS authority, which is what StorageHDFSConfiguration keeps as its raw URI. Check the catalog table against that same value, so a grant filtered on the authority allows both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7e71029 to
efecd83
Compare
|
🕵️ @SaadIMC The access check and the read-only storage look right to me: the check runs before anything is read from HDFS and matches what icebergHDFS checks, and every write or removal in HDFSObjectStorage goes through the guarded writeObject/removeObject. A few small things:
|
Reuse ITableFunction's grant-filter URI normalization instead of a copy, say in the READONLY error why the table is read-only, and drop the storage-type gtest that the integration test already covers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the comment! The description and changelog are updated now, and the READONLY message now explains: “tables of a DataLakeCatalog database located on HDFS are read-only”. Also dropped the gtest. |
|
Thanks @SaadIMC! One more CI run after master merge |
Description
Data lake catalogs report HDFS table locations using the
hdfsURI scheme, butDataLakeCatalogcould not read such tables:tryParseStorageTypeFromStringcapitalized only the first character, producingHdfs, which did not matchStorageType::HDFS, so every HDFS table failed withUnsupported storage type: hdfs://. The lowercasehdfsscheme is now recognized explicitly; parsing of other storage types is unchanged.vended_credentials = 1,buildTableEngineArgsthrewBAD_ARGUMENTSbecause a REST catalog vends no credentials for HDFS. HDFS authenticates (e.g. with Kerberos) through the server'shdfsconfiguration rather than engine arguments, so HDFS tables are exempt from this check.READ ON HDFSgrant asicebergHDFS, with filters matched against the same URI: the HDFS authority (e.g.READ ON HDFS('hdfs://namenode:9000')), not the full table location. The check runs before a storage is built or returned from the stateful-table cache, so it coversSELECTand the metadata read behindDESCRIBE. Writes reach HDFS through too many entry points to authorize each one, so these tables are read-only: theirHDFSObjectStoragerejects every write and removal withREADONLY. For the same reason they never use the stateful table path, whose background compaction would write to HDFS.Tests:
test_database_iceberg_hdfs_location) with a mock REST catalog that advertises anhdfs://location on a real HDFS:SHOW CREATE TABLE,DESCRIBEandSELECTunder default settings.READ ON HDFSgrant, or a grant filtered to another HDFS authority, is denied. A grant matching the authority (hdfs://hdfs1:9000) is allowed.READONLY, and the table directory on HDFS is unchanged.allow_experimental_iceberg_compaction = 1, reads still work and no backgroundREADONLYerrors appear.Closes: #128188
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
DataLakeCatalogdatabases can now read tables whose catalog location is on HDFS (hdfs://), including with the defaultvended_credentialssetting. Reading requires the sameREAD ON HDFSgrant asicebergHDFS(filters match the HDFS authority, e.g.hdfs://namenode:9000). Such tables are read-only; writes fail withREADONLY.Workflow [PR]
Sync PR [sync-upstream/pr/112468]
Version info
26.11.1.1338-master(included in26.11and later)