alexeykudinkin commented on code in PR #5828:
URL: https://github.com/apache/hudi/pull/5828#discussion_r907755195


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala:
##########
@@ -213,6 +221,26 @@ case class MergeIntoHoodieTableCommand(mergeInto: 
MergeIntoTable) extends Hoodie
     }
   }
 
+  /**
+   * Check whether expression of preCombine field have the same column name 
with target column.
+   *
+   * Merge expression cases that return true:
+   * 1) merge into .. on .. update set ts = s0.ts
+   * 2) merge into .. on .. update set ts = cast(s0.ts as int)
+   * 3) merge into .. on .. update set ts = s0.ts+1 (expressions like this 
whose sub node has the same column name with target)
+   * "ts" is preCombine field of h0.
+   */
+  private def isEqualToTargetPreCombineField(targetColumnName: String, 
sourceExpression: Expression): Boolean = {

Review Comment:
   Let's take a step back: what's the goal of this method? It's not just 
comparing whether the column is the same but rather sifting t/h nested 
expressions looking for `AttributeReference` that refers to the target column 
-- hence my suggestion to call it contains b/c it traverses the expression 
tree. When we call it `isSomethingEqual` it leaves an impression that we're 
just check the equality which is misleading in that case



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

Reply via email to