fix: [iceberg] Remove IcebergFileStream and use iceberg-rust's parallelization #3051
+84
−333
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.
Which issue does this PR close?
N/A
Rationale for this change
Profiling Iceberg native scans revealed significant overhead in async stream polling, particularly:
tokio::drop_wakerandtokio::park::cloneconsuming substantial time inIcebergStreamWrapper::poll_nextfutures_util::stream::flatten_unordered::SharedPollState::{start_polling,stop_polling}showing lock contentionI think this is due to:
SparkParquetOptions,SparkSchemaAdapterFactory, and schema adapters for every single batch via.and_then()combinatorIcebergFileStreampassed oneFileScanTaskat a time to iceberg-rust, causingflatten_unorderedto coordinate parallelization across a single task (pure overhead). Stream nesting created excessive waker churn.What changes are included in this PR?
IcebergFileStreamand pass allFileScanTasks directly to iceberg-rust. I tried this in the past but I can't remember why I abandoned it. Let's try again.How are these changes tested?
Existing tests.