dongkelun commented on a change in pull request #3700: URL: https://github.com/apache/hudi/pull/3700#discussion_r738093802
########## File path: hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala ########## @@ -161,23 +162,20 @@ case class HoodieResolveReferences(sparkSession: SparkSession) extends Rule[Logi val resolvedCondition = condition.map(resolveExpressionFrom(resolvedSource)(_)) val resolvedAssignments = if (isInsertOrUpdateStar(assignments)) { // assignments is empty means insert * or update set * - val resolvedSourceOutputWithoutMetaFields = resolvedSource.output.filter(attr => !HoodieSqlUtils.isMetaField(attr.name)) - val targetOutputWithoutMetaFields = target.output.filter(attr => !HoodieSqlUtils.isMetaField(attr.name)) - val resolvedSourceColumnNamesWithoutMetaFields = resolvedSourceOutputWithoutMetaFields.map(_.name) - val targetColumnNamesWithoutMetaFields = targetOutputWithoutMetaFields.map(_.name) + val resolvedSourceOutput = resolvedSource.output.filter(attr => !HoodieSqlUtils.isMetaField(attr.name)) + val targetOutput = target.output.filter(attr => !HoodieSqlUtils.isMetaField(attr.name)) - if(targetColumnNamesWithoutMetaFields.toSet.subsetOf(resolvedSourceColumnNamesWithoutMetaFields.toSet)){ + if(targetOutput.filter(attr => resolvedSourceOutput.map(_.name).exists(resolver(_, attr.name))).equals(targetOutput)){ Review comment: OK, modified ########## File path: hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala ########## @@ -101,11 +103,11 @@ case class MergeIntoHoodieTableCommand(mergeInto: MergeIntoTable) extends Runnab val target2Source = conditions.map(_.asInstanceOf[EqualTo]) .map { case EqualTo(left: AttributeReference, right) - if targetAttrs.indexOf(left) >= 0 => // left is the target field - left.name -> right + if targetAttrs.exists(f => attributeEqual(f, left, resolver)) => // left is the target field + targetAttrs.find(f => resolver(f.name, left.name)).get.name -> right Review comment: OK, modified -- 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-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org