You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/07/24 11:18:11 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #9252: [HUDI-6500] Fix bug when Using the RuntimeReplaceable function in the…

danny0405 commented on code in PR #9252:
URL: https://github.com/apache/hudi/pull/9252#discussion_r1272124257


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala:
##########
@@ -391,63 +392,65 @@ case class ResolveImplementationsEarly() extends Rule[LogicalPlan] {
 case class ResolveImplementations() extends Rule[LogicalPlan] {
 
   override def apply(plan: LogicalPlan): LogicalPlan = {
-    plan match {
-      // Convert to MergeIntoHoodieTableCommand
-      case mit@MatchMergeIntoTable(target@ResolvesToHudiTable(_), _, _) if mit.resolved =>
-        MergeIntoHoodieTableCommand(mit.asInstanceOf[MergeIntoTable])
-
-      // Convert to UpdateHoodieTableCommand
-      case ut@UpdateTable(plan@ResolvesToHudiTable(_), _, _) if ut.resolved =>
-        UpdateHoodieTableCommand(ut)
-
-      // Convert to DeleteHoodieTableCommand
-      case dft@DeleteFromTable(plan@ResolvesToHudiTable(_), _) if dft.resolved =>
-        DeleteHoodieTableCommand(dft)
-
-      // Convert to CompactionHoodieTableCommand
-      case ct @ CompactionTable(plan @ ResolvesToHudiTable(table), operation, options) if ct.resolved =>
-        CompactionHoodieTableCommand(table, operation, options)
-
-      // Convert to CompactionHoodiePathCommand
-      case cp @ CompactionPath(path, operation, options) if cp.resolved =>
-        CompactionHoodiePathCommand(path, operation, options)
-
-      // Convert to CompactionShowOnTable
-      case csot @ CompactionShowOnTable(plan @ ResolvesToHudiTable(table), limit) if csot.resolved =>
-        CompactionShowHoodieTableCommand(table, limit)
-
-      // Convert to CompactionShowHoodiePathCommand
-      case csop @ CompactionShowOnPath(path, limit) if csop.resolved =>
-        CompactionShowHoodiePathCommand(path, limit)
-
-      // Convert to HoodieCallProcedureCommand
-      case c @ CallCommand(_, _) =>
-        val procedure: Option[Procedure] = loadProcedure(c.name)
-        val input = buildProcedureArgs(c.args)
-        if (procedure.nonEmpty) {
-          CallProcedureHoodieCommand(procedure.get, input)
-        } else {
-          c
-        }
-
-      // Convert to CreateIndexCommand
-      case ci @ CreateIndex(plan @ ResolvesToHudiTable(table), indexName, indexType, ignoreIfExists, columns, options, output) =>
-        // TODO need to resolve columns
-        CreateIndexCommand(table, indexName, indexType, ignoreIfExists, columns, options, output)
-
-      // Convert to DropIndexCommand
-      case di @ DropIndex(plan @ ResolvesToHudiTable(table), indexName, ignoreIfNotExists, output) if di.resolved =>
-        DropIndexCommand(table, indexName, ignoreIfNotExists, output)
-
-      // Convert to ShowIndexesCommand
-      case si @ ShowIndexes(plan @ ResolvesToHudiTable(table), output) if si.resolved =>
-        ShowIndexesCommand(table, output)
-
-      // Covert to RefreshCommand
-      case ri @ RefreshIndex(plan @ ResolvesToHudiTable(table), indexName, output) if ri.resolved =>
-        RefreshIndexCommand(table, indexName, output)
-
-      case _ => plan
+    AnalysisHelper.allowInvokingTransformsInAnalyzer {
+      plan match {
+        // Convert to MergeIntoHoodieTableCommand

Review Comment:
   Can you elaborate a little more what is the purpose of this line:
   
   ```java
   AnalysisHelper.allowInvokingTransformsInAnalyzer 
   ```



-- 
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