-
Notifications
You must be signed in to change notification settings - Fork 515
Feature: Incremental Append Scan #3512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kevinjqliu
merged 19 commits into
apache:main
from
smaheshwar-pltr:sm/incremental-append-scan-v3
Jun 28, 2026
+886
−33
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0064fc9
Refactor: extract BaseScan and ManifestGroupPlanner
smaheshwar-pltr ece2b0f
Feature: Incremental Append Scan
smaheshwar-pltr ecfa2fb
Merge remote-tracking branch 'origin/main' into sm/table-scan-refactor
smaheshwar-pltr e6d94e4
Merge remote-tracking branch 'origin/main' into sm/incremental-append…
smaheshwar-pltr 8f5e9ad
Address review nits: drop redundant ABC base, keep extracted bodies a…
smaheshwar-pltr e9cb285
Merge branch 'sm/table-scan-refactor' into sm/incremental-append-scan-v3
smaheshwar-pltr 6a0ef60
Address review nits
smaheshwar-pltr e382729
Add test coverage for incremental append scan
smaheshwar-pltr df00b11
Drop implementation-coupled comment from no-snapshot test
smaheshwar-pltr acb10f7
Merge branch 'sm/table-scan-refactor' into sm/incremental-append-scan-v3
smaheshwar-pltr e1e47af
Merge remote-tracking branch 'origin/main' into sm/table-scan-refactor
smaheshwar-pltr 6e4cf3a
Merge branch 'sm/table-scan-refactor' into sm/incremental-append-scan-v3
smaheshwar-pltr a7e3f24
Merge main into sm/incremental-append-scan-v3
smaheshwar-pltr 41d3ee7
Require from_snapshot_id_exclusive and drop range builders on Increme…
smaheshwar-pltr bfa7903
Open up IncrementalAppendScan API: optional and inclusive start
smaheshwar-pltr 17c6237
Test that incremental append scan ignores compacted files
smaheshwar-pltr 7f675ab
Review polish: restore IAS covariance, tidy assertions and ancestry h…
smaheshwar-pltr 99dcfb5
Guard the compaction test against a no-op rewrite
smaheshwar-pltr b4e696c
Drop redundant comment on the compaction guard assert
smaheshwar-pltr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -395,3 +395,48 @@ | |
| ) | ||
| spark.sql(f"ALTER TABLE {catalog_name}.default.test_empty_scan_ordered_str WRITE ORDERED BY id") | ||
| spark.sql(f"INSERT INTO {catalog_name}.default.test_empty_scan_ordered_str VALUES 'a', 'c'") | ||
|
|
||
| # Append scan fixture. Snapshots written: | ||
| # 0: append (1, 'a') | ||
| # 1: append (2, 'b') | ||
| # 2: append (3, 'c'), (4, 'b') | ||
| # 3: compact -- rewrites the two letter='b' files into one (operation=replace) | ||
| # 4: delete number=2 | ||
| # 5: append (5, 'd', 100) -- on evolved schema | ||
| # 6: replace table -- lineage break | ||
| spark.sql( | ||
| f""" | ||
| CREATE OR REPLACE TABLE {catalog_name}.default.test_incremental_read ( | ||
| number integer, | ||
| letter string | ||
| ) | ||
| USING iceberg | ||
| PARTITIONED BY (letter) | ||
| TBLPROPERTIES ('format-version'='2') | ||
| """ | ||
| ) | ||
| spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read VALUES (1, 'a')") | ||
| spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read VALUES (2, 'b')") | ||
| spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read VALUES (3, 'c'), (4, 'b')") | ||
| # Compact: letter='b' has two files (from the previous two appends); rewrite them into one. | ||
| # This commits a non-append (replace) snapshot whose rewritten file the append scan must not pick up. | ||
|
Comment on lines
+421
to
+422
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressing #3512 (review) |
||
| spark.sql( | ||
| f""" | ||
| CALL {catalog_name}.system.rewrite_data_files( | ||
| table => 'default.test_incremental_read', | ||
| options => map('min-input-files', '2') | ||
| ) | ||
| """ | ||
| ) | ||
| spark.sql(f"DELETE FROM {catalog_name}.default.test_incremental_read WHERE number = 2") | ||
| spark.sql(f"ALTER TABLE {catalog_name}.default.test_incremental_read ADD COLUMN extra int") | ||
| spark.sql(f"INSERT INTO {catalog_name}.default.test_incremental_read VALUES (5, 'd', 100)") | ||
| spark.sql( | ||
| f""" | ||
| REPLACE TABLE {catalog_name}.default.test_incremental_read | ||
| USING iceberg | ||
| PARTITIONED BY (letter) | ||
| TBLPROPERTIES ('format-version'='2') | ||
| AS SELECT number, letter, extra FROM {catalog_name}.default.test_incremental_read | ||
| """ | ||
| ) | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are integration tests from java repo, would be good to follow up and replicate the different scenarios to see if the results line up when queried through pyiceberg's api vs spark's