Repository navigation
[AMORO-1304][Spark] Add read-only base store queries - #4563
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
Expose the base store through Iceberg batch readers in Spark 3.3, 3.4 and 3.5, with snapshot and timestamp reads and preserved historical schemas. Keep mutation interfaces out of the inspection table and refresh metadata before resolving snapshots or planning reads. Cover named and session catalogs for mixed Iceberg and mixed Hive, including metadata columns and rejected mutations. Generated-by: DeepSeek V4 Pro and OpenAI Codex
2 of 3 tasks
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why are the changes needed?
Implements the Spark part of #1304.
A mixed-format table can be queried by merge on read or through its change store, but Spark cannot query
table.base. This adds read-only batch access to the BaseStore, including retained-snapshot and timestamp queries, without reconstructing a historical merge of base and change data.Brief change log
.basein the mixed, unified and session catalogs for Spark 3.3, 3.4 and 3.5.How was this patch tested?
With JDK 11 and the repository's Maven 3.9.11 wrapper, ran
clean verifyfor each Spark 3.3/3.4/3.5 profile and matching module, including dependencies. Each run executed 51 selected tests with no failures, errors or skips: the new BaseStore contracts and the neighboringTestSelectSQL,TestSessionCatalogandTestUnifiedCatalogtests.Example for Spark 3.5:
./mvnw -Pspark-3.5 \ -pl amoro-format-mixed/amoro-mixed-spark/v3.5/amoro-mixed-spark-3.5 -am \ '-Dtest=*BaseStoreSQL,TestSelectSQL,TestSessionCatalog,TestUnifiedCatalog' \ clean verifyThe tests cover keyed/unkeyed tables, separate base/change contents, empty-table reads followed by writes, current and historical schemas, snapshot/timestamp selection, invalid history requests, and rejecting mutations while preserving the parent's rows and snapshot. They exercise named and session catalogs for both mixed Iceberg and mixed Hive. After extending the metadata assertion, reran the eight query/read-only cases per profile and verified
_fileagainst the committed data file and_posagainst its row position; all passed without skips.Before the change, the original SQL example failed on
.baseafter its ordinary and.changecontrols passed. The separate unified-session regression also failed on historical reads before its routing fix. The documentation site was built with Hugo and the new section was checked in the rendered page.The upstream Core/hadoop3 CI passed all five jobs on this head: Spark 3.3/3.4/3.5 with JDK 11, Spark 3.5 with JDK 17, and the Spark 4.1 optimizer with JDK 17. Maintainer review and merge are still pending.
The separate PR labeler run stopped at startup before creating any jobs; no run log is available. It did not execute tests.
Documentation
docs/engines/spark/spark-queries.mdand added Javadocs for the read-only adapter.AI assistance: DeepSeek V4 Pro contributed implementation and first-pass review; OpenAI Codex coordinated the work, corrected and reviewed the patch, ran validation, and prepared this description.