shenjiayu17 commented on code in PR #5828:
URL: https://github.com/apache/hudi/pull/5828#discussion_r906637411
##########
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:
I tried to improve the name of these two methods. How about this:
`isEqualTo` to `isSameColumnName`
`isEqualToTargetPreCombineField` to `containsSameColumnNameForPreCombine`
Because `isEqualTo` is for columns in merge condition, maybe not only
primaryKey.
And both of the two methods are to find whether column name is equal, not
whether field is contained.
--
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]