kasakrisz commented on code in PR #6685:
URL: https://github.com/apache/hive/pull/6685#discussion_r4026577683
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/MergeSemanticAnalyzer.java:
##########
@@ -130,7 +130,15 @@ WHEN NOT MATCHED THEN INSERT VALUES (source.a2, source.b2)
.sourceName(sourceName)
.sourceAlias(getSourceAlias(source, sourceName))
.onClauseAsText(onClauseAsText);
-
+
+ OnClauseAnalyzer oca = new OnClauseAnalyzer(onClause, targetTable,
targetAlias,
+ conf, onClauseAsText);
+ oca.analyze();
+ // unresolved columns are not allowed in the on clause to avoid wrong
results
+ if (!oca.unresolvedColumns.isEmpty()) {
Review Comment:
I see two approaches for the fix:
1. Check for column ambiguity in COW only: Move the check to a COW-specific
class like `CopyOnWriteMergeRewriter`.
2. Check generally (as proposed in this PR): Keep the check here in
`MergeSemanticAnalyzer`, but ensure no breaking changes [1] are introduced to
the supported SQL syntax. Please refine this further.
[1] https://github.com/apache/hive/pull/6685#discussion_r4007683241
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]