perf: [iceberg] reduce nativeIcebergScanMetadata serialization points#3243
Merged
Conversation
…bergNativeScanExec since it's redundant to the wrapped scan object and introduces a ton of serde overhead.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3243 +/- ##
============================================
+ Coverage 56.12% 60.04% +3.92%
- Complexity 976 1428 +452
============================================
Files 119 170 +51
Lines 11743 15769 +4026
Branches 2251 2604 +353
============================================
+ Hits 6591 9469 +2878
- Misses 4012 4981 +969
- Partials 1140 1319 +179 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Running TPC-H SF10 locally I see a reduction in serialization calls. Hopefully that yields reduced GC pressure since I can't seem to reproduce that behavior on my machine with my workloads. |
Contributor
Author
|
Upon thinking about this more, I don't think this is a huge win for executor memory pressure, maybe driver side. I suspect we'll need to do more work to figure out how to not serialize every partitions' FileScanTasks in the Comet native plan. |
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.
Which issue does this PR close?
Closes #.
Rationale for this change
During Iceberg workloads, profiling revealed high GC time caused by Java deserialization of
List$SerializationProxyobjects (22.1 MiB allocations per task).CometIcebergNativeScanMetadatacontains heavyweight Iceberg objects (FileScanTasks list, table, schemas) with nested Scala collections. These were being included inequals()/hashCode()methods, causing Java serializer to recursively traverse the entire object graph during task serialization, creating allocation pressure.The metadata is only needed during query planning to convert Iceberg metadata to protobuf. After conversion, all necessary information exists in the serialized
nativeOp, making the metadata unnecessary.What changes are included in this PR?
nativeIcebergScanMetadataas@transientinCometBatchScanExecto prevent serialization to executorsnativeIcebergScanMetadatafromequals()/hashCode()in bothCometBatchScanExecandCometIcebergNativeScanExecto prevent object graph traversal during plan comparisonnativeIcebergScanMetadata = NoneinCometBatchScanExec.doCanonicalize()to free driver memory during plan optimizationEquivalence checking remains correct because
wrappedScan.equals()already compares the underlyingBatchScanExecwith all its Iceberg metadata.How are these changes tested?
Existing tests. I will try to benchmark it locally as well.