Skip to content

test: Add Iceberg branch and tags support related tests in Prestissimo#27272

Merged
agrawalreetika merged 1 commit intoprestodb:masterfrom
agrawalreetika:native-iceberg-wap-test
Mar 9, 2026
Merged

test: Add Iceberg branch and tags support related tests in Prestissimo#27272
agrawalreetika merged 1 commit intoprestodb:masterfrom
agrawalreetika:native-iceberg-wap-test

Conversation

@agrawalreetika
Copy link
Copy Markdown
Member

@agrawalreetika agrawalreetika commented Mar 5, 2026

Description

Add Iceberg branch and tags support related tests in Prestissimo

Motivation and Context

Add Iceberg branch and tags support related tests in Prestissimo

Impact

Add Iceberg branch and tags support related tests in Prestissimo

Test Plan

Test Added

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

Summary by Sourcery

Add native execution tests for Iceberg table branches and tags behavior in Prestissimo.

Tests:

  • Add coverage for querying Iceberg branches via system versioning and dot-notation in native execution.
  • Add tests for creating and querying Iceberg tags and verifying their referenced snapshots.
  • Add tests for creating and dropping Iceberg branches and tags, including IF EXISTS handling and refs metadata visibility.
  • Add tests validating insert and truncate support on Iceberg branches and that unsupported UPDATE/DELETE/MERGE operations fail as expected in Prestissimo.

@agrawalreetika agrawalreetika self-assigned this Mar 5, 2026
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Mar 5, 2026
@prestodb-ci prestodb-ci requested review from a team, auden-woolfson and jp-sivaprasad and removed request for a team March 5, 2026 20:57
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 5, 2026

Reviewer's Guide

Adds Prestissimo native Iceberg tests that exercise branch and tag querying and mutation semantics, validating both FOR SYSTEM_VERSION AS OF and dot-notation syntax, plus refs-table visibility and failure modes for unsupported or invalid operations.

File-Level Changes

Change Details Files
Add native execution test coverage for querying Iceberg branches via FOR SYSTEM_VERSION AS OF and dot-notation, and ensure parity between syntaxes and with the main branch.
  • Introduce TestPrestoNativeIcebergTagsAndBranches extending AbstractTestQueryFramework and wiring native and Java Iceberg query runners with consistent storage format and path settings.
  • Create testQueryBranch to validate creating a branch, querying it via FOR SYSTEM_VERSION AS OF and dot-notation, comparing result sets, and confirming the main table reflects all rows.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeIcebergTagsAndBranches.java
Add native execution test coverage for Iceberg tags, including creation, querying via FOR SYSTEM_VERSION AS OF, and visibility in the refs metadata table.
  • Implement testQueryTag to verify tag creation, snapshot isolation semantics, and correct row counts for tag and main branch.
  • Implement testCreateTag to validate tag creation on the current snapshot, subsequent inserts, snapshot behavior when querying by tag, and refs-table metadata for TAG entries.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeIcebergTagsAndBranches.java
Add native execution test coverage for Iceberg branches lifecycle (create, list via refs, drop, error handling, and IF EXISTS semantics).
  • Implement testCreateBranch to validate branch creation on the current snapshot, post-creation inserts, snapshot behavior when querying by branch, and refs-table metadata for BRANCH entries including main and the new branch.
  • Implement testDropBranch to cover dropping existing branches, verifying refs-table counts decrease, ensuring queries against dropped branches fail, queries against remaining branches succeed, and DROP BRANCH IF EXISTS on existing and non-existent branches behaves as expected.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeIcebergTagsAndBranches.java
Add native execution test coverage for Iceberg tags lifecycle (create, list via refs, drop, error handling, and IF EXISTS semantics).
  • Implement testDropTag to cover creating multiple tags, verifying refs-table counts, dropping tags, confirming queries against dropped tags fail while existing tags still work, asserting DROP TAG on non-existent tags fails, and DROP TAG IF EXISTS succeeds for both existing and non-existent tags.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeIcebergTagsAndBranches.java
Add native execution test coverage for data mutations on Iceberg branches, including supported INSERT/TRUNCATE via dot-notation and failure modes for unsupported UPDATE/DELETE/MERGE operations.
  • Implement testBranchMutation to validate inserting into branches via dot-notation, confirm isolation from the main branch, verify TRUNCATE TABLE on branch leaves main branch unchanged, and assert UPDATE, DELETE, and MERGE operations against branches fail as currently unsupported.
presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeIcebergTagsAndBranches.java

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In the negative tests you often use very generic failure matchers like (?s).*; consider asserting on a more specific substring of the expected error message (as you did with tag/branch names) so regressions in failure modes are more precisely detected.
  • There is a fair amount of duplication in the setup/teardown patterns (e.g., DROP TABLE IF EXISTS + CREATE TABLE with similar schemas); extracting small helper methods for common patterns could make the tests shorter and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the negative tests you often use very generic failure matchers like `(?s).*`; consider asserting on a more specific substring of the expected error message (as you did with tag/branch names) so regressions in failure modes are more precisely detected.
- There is a fair amount of duplication in the setup/teardown patterns (e.g., `DROP TABLE IF EXISTS` + `CREATE TABLE` with similar schemas); extracting small helper methods for common patterns could make the tests shorter and easier to maintain.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@agrawalreetika agrawalreetika force-pushed the native-iceberg-wap-test branch from 9c8ec5f to 702a491 Compare March 6, 2026 05:54
Copy link
Copy Markdown
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

Thanks for the doc! Just one nit, looks good!

hantangwangd
hantangwangd previously approved these changes Mar 7, 2026
Copy link
Copy Markdown
Member

@hantangwangd hantangwangd left a comment

Choose a reason for hiding this comment

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

Thanks @agrawalreetika, lgtm apart from @steveburnett's comment.

Copy link
Copy Markdown
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull updated branch, new local doc build, looks good. Thanks!

@agrawalreetika agrawalreetika merged commit 0f5d277 into prestodb:master Mar 9, 2026
114 of 119 checks passed
@agrawalreetika agrawalreetika deleted the native-iceberg-wap-test branch March 9, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants