https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala#L85
I can't understand this code, it seems to be a "bug", but group by of SparkSQL just works fine. with code below, some expressions are mapping to AttributeReferences, then "bindReference" method will find there references. But resultAttribute's exprId is new, I don't think it can find the true reference(But it does, Why? How?) private[this] val resultExpressions = aggregateExpressions.map { agg => agg.transform { case e: Expression if resultMap.contains(e) => resultMap(e) } } I'm trying to write a DSL with Catalyst -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/SparkSQL-Why-this-AttributeReference-exprId-is-not-setted-tp9521.html Sent from the Apache Spark Developers List mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@spark.apache.org For additional commands, e-mail: dev-h...@spark.apache.org