Spark 3.4: Pass FileIO on Spark's read path#16307
Merged
Merged
Conversation
Backport of apache#15683 (and length fix apache#16284) to spark/v3.4. Note: BaseReader required an adaptation \u2014 v3.4 still used the legacy table.encryption().decrypt(...) path. Switched it to fileIO.bulkDecrypt(...) to match v3.5/4.0/4.1, since the broadcast FileIO is now an EncryptingFileIO (combined in the constructor). All other files match the v3.5 patch byte-for-byte (with paths translated).
huaxingao
approved these changes
May 13, 2026
Contributor
Author
|
thanks for the review! since this is a backport and only for spark 3.4, im comfortable with merging it in as is 😄 |
kevinjqliu
added a commit
to kevinjqliu/iceberg
that referenced
this pull request
May 13, 2026
Backport of apache#15992 to spark/v3.4. Stacked on PR apache#16307 (apache#15683 SerializableFileIOWithSize), which is itself a backport. Adaptations from the source PR: - SparkMicroBatchStream.java was replaced wholesale with the v3.5 post-apache#15992 version because v3.4 had structural drift; the refactor extracts the planning logic into the new planner classes and there are no v3.4-only features in this file. - TestStructuredStreamingRead3.java was likewise replaced with the v3.5 version (which adds parameterized sync/async coverage). The only non-mechanical change is using 'SparkCatalogConfig.SPARK' instead of 'SparkCatalogConfig.SPARK_SESSION', because v3.4 still uses the older enum name.
kevinjqliu
added a commit
that referenced
this pull request
May 13, 2026
Backport of #15992 to spark/v3.4. Stacked on PR #16307 (#15683 SerializableFileIOWithSize), which is itself a backport. Adaptations from the source PR: - SparkMicroBatchStream.java was replaced wholesale with the v3.5 post-#15992 version because v3.4 had structural drift; the refactor extracts the planning logic into the new planner classes and there are no v3.4-only features in this file. - TestStructuredStreamingRead3.java was likewise replaced with the v3.5 version (which adds parameterized sync/async coverage). The only non-mechanical change is using 'SparkCatalogConfig.SPARK' instead of 'SparkCatalogConfig.SPARK_SESSION', because v3.4 still uses the older enum name.
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.
Backport of #15683 (and length fix #16284) to
spark/v3.4.Introduces
SerializableFileIOWithSizeto broadcast a table'sFileIOto executors alongside the table metadata. Provides aKnownSizeEstimationso Spark skips the expensiveSizeEstimatorwalk during broadcast, and makesclose()a no-op on executors so broadcast cleanup does not destroy the driver's FileIO.Adaptation note
v3.4's
BaseReaderstill used the legacytable.encryption().decrypt(...)path. I switched that one method tofileIO.bulkDecrypt(...)to match v3.5/4.0/4.1, since the broadcastFileIOis now anEncryptingFileIO(combined in the constructor). All other files match the v3.5 patch byte-for-byte (with paths translated).Validation
./gradlew -DsparkVersions=3.4 :iceberg-spark:iceberg-spark-3.4_2.12:test --tests "*SerializableFileIOWithSize*"(new test, passes)./gradlew -DsparkVersions=3.4 :iceberg-spark:iceberg-spark-3.4_2.12:test --tests "org.apache.iceberg.spark.source.TestSparkReaderDeletes"(passes)