szehon-ho commented on code in PR #52866:
URL: https://github.com/apache/spark/pull/52866#discussion_r2492415455
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1749,7 +1749,8 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
m.copy(mergeCondition = resolvedMergeCondition,
matchedActions = newMatchedActions,
notMatchedActions = newNotMatchedActions,
- notMatchedBySourceActions = newNotMatchedBySourceActions)
+ notMatchedBySourceActions = newNotMatchedBySourceActions,
+ originalSourceActions = newMatchedActions ++
newNotMatchedActions)
Review Comment:
Hm, i tried `referencedSchema`. However, it tries to call the schema method
a bit too early, before the "stars" are resolved:
```
[INTERNAL_ERROR] Invalid call to toAttribute on unresolved object SQLSTATE:
XX000
org.apache.spark.sql.catalyst.analysis.UnresolvedException: [INTERNAL_ERROR]
Invalid call to toAttribute on unresolved object SQLSTATE: XX000
at
org.apache.spark.sql.catalyst.analysis.Star.toAttribute(unresolved.scala:460)
at
org.apache.spark.sql.catalyst.analysis.Star.toAttribute$(unresolved.scala:460)
at
org.apache.spark.sql.catalyst.analysis.UnresolvedStar.toAttribute(unresolved.scala:864)
at
org.apache.spark.sql.catalyst.plans.logical.Project.$anonfun$output$1(basicLogicalOperators.scala:75)
at scala.collection.immutable.List.map(List.scala:236)
at scala.collection.immutable.List.map(List.scala:79)
at
org.apache.spark.sql.catalyst.plans.logical.Project.output(basicLogicalOperators.scala:75)
at
org.apache.spark.sql.catalyst.plans.logical.SubqueryAlias.output(basicLogicalOperators.scala:1739)
at
org.apache.spark.sql.catalyst.plans.QueryPlan.$anonfun$_schema$1(QueryPlan.scala:467)
at
org.apache.spark.util.BestEffortLazyVal.apply(BestEffortLazyVal.scala:53)
at
org.apache.spark.sql.catalyst.plans.QueryPlan.schema(QueryPlan.scala:464)
at
org.apache.spark.sql.catalyst.plans.logical.MergeIntoTable$.apply(v2Commands.scala:939)
at
org.apache.spark.sql.catalyst.parser.AstBuilder.$anonfun$visitMergeIntoTable$1(AstBuilder.scala:1152)
```
--
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]