You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/06/06 12:47:29 UTC
[GitHub] [spark] cloud-fan commented on a diff in pull request #41475: [SPARK-43979][SQL] CollectedMetrics should be treated as the same one for self-join
cloud-fan commented on code in PR #41475:
URL: https://github.com/apache/spark/pull/41475#discussion_r1219586024
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -1064,6 +1066,32 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB
check(plan)
}
+ /**
+ * This method is only used for checking collected metrics. This method tries to
+ * remove extra alias-only project from the plan so that we can identify exact
+ * duplicates metric definition.
+ */
+ private def simplifyPlanForCollectedMetrics(plan: LogicalPlan): LogicalPlan = {
+ plan.resolveOperatorsDown {
+ case p: Project if p.projectList.size == p.child.output.size =>
+ var ret = true
+ p.projectList.zip(p.child.output).foreach({
Review Comment:
```
val assignExprIdOnly = p.projectList.zip(p.child.output).forall {
case (left: Alias, right: Attribute) => ...
case _ => false
}
...
```
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org