[#9414] feat (trino-connector) Add support for querying iceberg metadata tables#9415
Merged
diqiu50 merged 4 commits intoapache:mainfrom Dec 12, 2025
Merged
Conversation
Contributor
Contributor
|
SQL-level tests and distributed-environment tests are required. |
Contributor
Author
|
Just added a SQL integration test, can you help with re-running the workflow to check? |
yuqi1129
pushed a commit
that referenced
this pull request
Feb 6, 2026
…a tables (#9415) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[#123] feat(operator): support xxx" - "[#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? Added `getSystemTable()` override in `GravitinoMetadata` to delegate system table lookups to internal connector. This enables querying Iceberg metadata tables like `$snapshots` and `$manifests`, with trino connector. ### Why are the changes needed? For a bug fix - as of right now iceberg metadata tables are not queryable with the gravitino trino connector. Fix: #9414 ### Does this PR introduce _any_ user-facing change? Yes, users will now be able to query iceberg metatables. ### How was this patch tested? Without fix, unit test fails: ``` TestGravitinoMetadataGetSystemTable > testGetSystemTableDelegatesToInternalMetadata() FAILED org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63) at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36) at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31) at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:179) at app//org.apache.gravitino.trino.connector.TestGravitinoMetadataGetSystemTable.testGetSystemTableDelegatesToInternalMetadata(TestGravitinoMetadataGetSystemTable.java:58) ``` Also, made a targz of the change with ```./gradlew assembleTrinoConnector ``` and added trino deployment, then querying snapshots worked. --------- Co-authored-by: Yuhui <hui@datastrato.com>
FANNG1
pushed a commit
to FANNG1/gravitino
that referenced
this pull request
Mar 6, 2026
…etadata tables (apache#9415) <!-- 1. Title: [#<issue>] <type>(<scope>): <subject> Examples: - "[apache#123] feat(operator): support xxx" - "[apache#233] fix: check null before access result in xxx" - "[MINOR] refactor: fix typo in variable name" - "[MINOR] docs: fix typo in README" - "[apache#255] test: fix flaky test NameOfTheTest" Reference: https://www.conventionalcommits.org/en/v1.0.0/ 2. If the PR is unfinished, please mark this PR as draft. --> ### What changes were proposed in this pull request? Added `getSystemTable()` override in `GravitinoMetadata` to delegate system table lookups to internal connector. This enables querying Iceberg metadata tables like `$snapshots` and `$manifests`, with trino connector. ### Why are the changes needed? For a bug fix - as of right now iceberg metadata tables are not queryable with the gravitino trino connector. Fix: apache#9414 ### Does this PR introduce _any_ user-facing change? Yes, users will now be able to query iceberg metatables. ### How was this patch tested? Without fix, unit test fails: ``` TestGravitinoMetadataGetSystemTable > testGetSystemTableDelegatesToInternalMetadata() FAILED org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63) at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36) at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31) at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:179) at app//org.apache.gravitino.trino.connector.TestGravitinoMetadataGetSystemTable.testGetSystemTableDelegatesToInternalMetadata(TestGravitinoMetadataGetSystemTable.java:58) ``` Also, made a targz of the change with ```./gradlew assembleTrinoConnector ``` and added trino deployment, then querying snapshots worked. --------- Co-authored-by: Yuhui <hui@datastrato.com>
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.
What changes were proposed in this pull request?
Added
getSystemTable()override inGravitinoMetadatato delegate system table lookups to internal connector. This enables querying Iceberg metadata tables like$snapshotsand$manifests, with trino connector.Why are the changes needed?
For a bug fix - as of right now iceberg metadata tables are not queryable with the gravitino trino connector.
Fix: #9414
Does this PR introduce any user-facing change?
Yes, users will now be able to query iceberg metatables.
How was this patch tested?
Without fix, unit test fails:
Also, made a targz of the change with
./gradlew assembleTrinoConnectorand added trino deployment, then querying snapshots worked.