cloud-fan commented on code in PR #51210:
URL: https://github.com/apache/spark/pull/51210#discussion_r2153458144
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala:
##########
@@ -1316,4 +1316,21 @@ abstract class SQLViewSuite extends QueryTest with
SQLTestUtils {
assert(ts1._1.getTime < ts2._1.getTime)
}
}
+
+ test("SPARK-52521: view with ANSI expressions") {
Review Comment:
before the fix, it fails with
```
[info] org.apache.spark.sql.catalyst.ExtendedAnalysisException:
[MISSING_AGGREGATION] The non-aggregating expression "id" is based on columns
which are not participating in the GROUP BY clause.
[info] Add the columns or the expression to the GROUP BY, aggregate the
expression, or use "any_value(id)" if you do not care which of the values
within a group is returned. SQLSTATE: 42803;
[info] Project [cast(c#4 as string) AS c#5]
[info] +- Aggregate [right(cast(id#6L as string), 1)], [right(cast(id#6L as
string), 1) AS c#4]
[info] +- Range (0, 1, step=1)
```
The two `Right` expressions are considered as different because the
`UnaryMinus` in the `replacement` have different `failOnError` flag values.
--
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]