fix(delta): drain all batches per scan file in DeltaInputSourceIterator #19592
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 248 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #19592"
general
weight: 0.35
abhishekrb19
Fixes #18606.
Description
Bug
DeltaInputSourceIterator.hasNext()used a local variable for the per-fileCloseableIterator<FilteredColumnarBatch>. When the method returnedtrueafterfinding the first non-empty batch of a file, that iterator went out of scope.
The next
hasNext()call advanced to the next file, skipping all remainingbatches of the current file.
With the Delta kernel's default batch size of 1024 rows, this produced exactly
1024 × numFilesrows regardless of actual file size — matching the symptomreported in #18606.
Fix
Promoted
filteredBatchIteratorto a class field (currentFileIterator).hasNext()now drains all batches of the current file before advancing to thenext one. Also fixed
close()to closecurrentFileIteratorand drain allremaining file iterators (the original only closed one).
Regression test
Added
LargeRowGroupDeltaTable(2 Parquet files × 2000 rows = 4000 total) andBatchDrainRegressionTestsinsideDeltaInputSourceTest.1024 × 2 = 2048rows returned4000rows returnedRelease note
Fixed a bug in the Delta Lake input source where only 1024 rows per Parquet file
were ingested. Ingestion tasks now return all rows from each file.
---
##### Key changed/added classes in this PR
DeltaInputSourceReader(fix)LargeRowGroupDeltaTable(new test descriptor)DeltaInputSourceTest(newBatchDrainRegressionTestsinner class)src/test/resources/large-row-group-table(new test Delta table)---
This PR has: