fix: Support Databricks Spark runtime#18256
Open
yihua wants to merge 1 commit intoapache:branch-0.xfrom
Open
Conversation
linliu-code
approved these changes
Feb 26, 2026
3f18780 to
e5e9a9f
Compare
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.
Describe the issue this Pull Request addresses
Cherrypicking #13129 to
branch-0.xSummary and Changelog
This PR makes Hudi tables queryable on Databricks Spark runtime. With the fix, the datasource reader can read Hudi tables leveraging
SparkHoodieTableFileIndexwithout using the metadata table.The root cause of the issue is that the
FileStatusCachefrom Databricks Spark runtime has different APIs compared to OSS Spark, leading to theNoSuchMethodErrorbelow:FileStatusCache's declared methods on Databricks Spark runtime:As seen, the second parameter of
putLeafFilesis of typeSerializableFileStatus[]which is different fromFileStatus[]in OSS.Two alternatives are explored:
putLeafFileswe have to have the classSerializableFileStatusto pass the type safety check (i.e., passingSerializableFileStatus[]instead ofObject[]which is the only possible way; otherwise seeingIllegalArgumentException: argument type mismatch). As the classSerializableFileStatusis no longer available in OSS Spark, the reflection route is not possible.NoSuchMethodError.COW table generated by Spark Quick Start is validated (using
spark.read.format("org.apache.hudi.Spark3DefaultSource").option("hoodie.metadata.enable", "false").load(tablePath)).Impact
Fixes reading Hudi tables leveraging
SparkHoodieTableFileIndexwithout using the metadata table.Risk Level
none
Documentation Update
none
Contributor's checklist