yihua commented on code in PR #5943: URL: https://github.com/apache/hudi/pull/5943#discussion_r929405590
########## hudi-spark-datasource/README.md: ########## @@ -50,7 +52,13 @@ has no class since hudi only supports spark 2.4.4 version, and it acts as the pl | 3.1.2 | No | | 3.2.0 | Yes | -### About upgrading Time Travel: +### To improve: Spark3.3 support time travel syntax link [SPARK-37219](https://issues.apache.org/jira/browse/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` +* hudi-spark3.3.x's `HoodieSpark3_3ExtendedSqlAstBuilder.scala`、`HoodieSpark3_3ExtendedSqlParser.scala`、`TimeTravelRelation.scala`、`SqlBase.g4`、`HoodieSqlBase.g4` Review Comment: nit: replace `、` with `,` ########## hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala: ########## @@ -44,15 +44,24 @@ import scala.collection.mutable.ListBuffer object HoodieAnalysis { type RuleBuilder = SparkSession => Rule[LogicalPlan] - def customOptimizerRules: Seq[RuleBuilder] = + def customOptimizerRules: Seq[RuleBuilder] = { if (HoodieSparkUtils.gteqSpark3_1) { - val nestedSchemaPruningClass = "org.apache.spark.sql.execution.datasources.NestedSchemaPruning" - val nestedSchemaPruningRule = ReflectionUtils.loadClass(nestedSchemaPruningClass).asInstanceOf[Rule[LogicalPlan]] + var nestedSchemaPruningClass = "ClassName" + if (HoodieSparkUtils.gteqSpark3_3) { + nestedSchemaPruningClass = "org.apache.spark.sql.execution.datasources.Spark33NestedSchemaPruning" + } else if (HoodieSparkUtils.gteqSpark3_2) { + nestedSchemaPruningClass = "org.apache.spark.sql.execution.datasources.Spark32NestedSchemaPruning" + } else { + // spark 3.1 + nestedSchemaPruningClass = "org.apache.spark.sql.execution.datasources.Spark31NestedSchemaPruning" + } Review Comment: nit: sth like ``` val nestedSchemaPruningClass = if (HoodieSparkUtils.gteqSpark3_3) { "org.apache.spark.sql.execution.datasources.Spark33NestedSchemaPruning" } else if (HoodieSparkUtils.gteqSpark3_2) { "org.apache.spark.sql.execution.datasources.Spark32NestedSchemaPruning" } else { // spark 3.1 "org.apache.spark.sql.execution.datasources.Spark31NestedSchemaPruning" } ``` ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
