Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/6110#discussion_r30321573
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
@@ -198,10 +198,12 @@ class Analyzer(
g.bitmasks.foreach { bitmask =>
// get the non selected grouping attributes according to the bit
mask
- val nonSelectedGroupExprSet = buildNonSelectExprSet(bitmask,
g.groupByExprs)
+ val nonSelectedGroupExprs = buildNonSelectExprs(bitmask,
g.groupByExprs)
val substitution = (g.child.output :+ g.gid).map(expr => expr
transformDown {
- case x: Expression if nonSelectedGroupExprSet.contains(x) =>
+ case x: Expression
+ if nonSelectedGroupExprs.find(
+ ExpressionEquality(_) == ExpressionEquality(x)).isDefined
=>
--- End diff --
How about we add `semanticEquals` method to `Expression` and implement it
with `equals` as default? Then we can override `semanticEquals` for
`AttributeReference` and just write `_.semanticEquals(x)` here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]