As has been outlined in HUDI-4176, we've hit a roadblock while testing Hudi on a large dataset (~1Tb) having pretty fat commits where Hudi's commit metadata could reach into 100s of Mbs. Given the size some of ours commit metadata instances Spark's parsing and resolving phase (when spark.sql(...) is involved, but before returned Dataset is dereferenced) starts to dominate some of our queries' execution time. - Rebased onto new APIs to avoid excessive Hadoop's Path allocations - Eliminated hasOperationField completely to avoid repeatitive computations - Cleaning up duplication in HoodieActiveTimeline - Added caching for common instances of HoodieCommitMetadata - Made tableStructSchema lazy;
Description of the relationship between each module
This repo contains the code that integrate Hudi with Spark. The repo is split into the following modules
hudi-spark
hudi-spark2
hudi-spark3
hudi-spark3.1.x
hudi-spark2-common
hudi-spark3-common
hudi-spark-common
- hudi-spark is the module that contains the code that both spark2 & spark3 version would share, also contains the antlr4 file that supports spark sql on spark 2.x version.
- hudi-spark2 is the module that contains the code that compatible with spark 2.x versions.
- hudi-spark3 is the module that contains the code that compatible with spark 3.2.0(and above) versions。
- hudi-spark3.1.x is the module that contains the code that compatible with spark3.1.x and spark3.0.x version.
- hudi-spark2-common is the module that contains the code that would be reused between spark2.x versions, right now the module has no class since hudi only supports spark 2.4.4 version, and it acts as the placeholder when packaging hudi-spark-bundle module.
- hudi-spark3-common is the module that contains the code that would be reused between spark3.x versions.
- hudi-spark-common is the module that contains the code that would be reused between spark2.x and spark3.x versions.
Description of Time Travel
HoodieSpark3_2ExtendedSqlAstBuilderhave comments in the spark3.2's code fork fromorg.apache.spark.sql.catalyst.parser.AstBuilder, and additionalwithTimeTravelmethod.SqlBase.g4have comments in the code forked from spark3.2's parser, and add SparkSQL SyntaxTIMESTAMP AS OFandVERSION AS OF.
Time Travel Support Spark Version:
| version | support |
|---|---|
| 2.4.x | No |
| 3.0.x | No |
| 3.1.2 | No |
| 3.2.0 | Yes |
About upgrading Time Travel:
Spark3.3 support time travel syntax link SPARK-37219. Once Spark 3.3 released. The files in the following list will be removed:
- hudi-spark3's
HoodieSpark3_2ExtendedSqlAstBuilder.scala、HoodieSpark3_2ExtendedSqlParser.scala、TimeTravelRelation.scala、SqlBase.g4、HoodieSqlBase.g4