You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/07/25 01:48:18 UTC

[GitHub] [hudi] leesf commented on a diff in pull request #5943: [HUDI-4186] Support Hudi with Spark 3.3.0

leesf commented on code in PR #5943:
URL: https://github.com/apache/hudi/pull/5943#discussion_r928353409


##########
hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/adapter/BaseSpark3Adapter.scala:
##########
@@ -81,23 +80,12 @@ abstract class BaseSpark3Adapter extends SparkAdapter with Logging {
     }
   }
 
-  override def createExtendedSparkParser: Option[(SparkSession, ParserInterface) => ParserInterface] = {
-    // since spark3.2.1 support datasourceV2, so we need to a new SqlParser to deal DDL statment
-    if (SPARK_VERSION.startsWith("3.1")) {
-      val loadClassName = "org.apache.spark.sql.parser.HoodieSpark312ExtendedSqlParser"
-      Some {
-        (spark: SparkSession, delegate: ParserInterface) => {
-          val clazz = Class.forName(loadClassName, true, Thread.currentThread().getContextClassLoader)
-          val ctor = clazz.getConstructors.head
-          ctor.newInstance(spark, delegate).asInstanceOf[ParserInterface]
-        }
-      }
-    } else {
-      None
-    }
-  }
-
   override def createInterpretedPredicate(e: Expression): InterpretedPredicate = {
     Predicate.createInterpreted(e)
   }
+
+  override def getQueryParserFromExtendedSqlParser(session: SparkSession, delegate: ParserInterface,

Review Comment:
   can this method defined in `SparkAdapter` and default implement is unsupported ?



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org