Eric5553 commented on a change in pull request #27685: [SPARK-30940][SQL] 
Remove attributeId in auto-generated arguments when Explain SQL query
URL: https://github.com/apache/spark/pull/27685#discussion_r390087193
 
 

 ##########
 File path: 
sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_having.sql.out
 ##########
 @@ -143,7 +143,7 @@ SELECT udf(a) FROM test_having HAVING udf(min(a)) < 
udf(max(a))
 struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
-grouping expressions sequence is empty, and 
'spark_catalog.default.test_having.`a`' is not an aggregate function. Wrap 
'(min(spark_catalog.default.test_having.`a`) AS `min(a#x)`, 
max(spark_catalog.default.test_having.`a`) AS `max(a#x)`)' in windowing 
function(s) or wrap 'spark_catalog.default.test_having.`a`' in first() (or 
first_value) if you don't care which value you get.;
+grouping expressions sequence is empty, and 
'spark_catalog.default.test_having.`a`' is not an aggregate function. Wrap 
'(min(spark_catalog.default.test_having.`a`) AS `min(a)`, 
max(spark_catalog.default.test_having.`a`) AS `max(a)`)' in windowing 
function(s) or wrap 'spark_catalog.default.test_having.`a`' in first() (or 
first_value) if you don't care which value you get.;
 
 Review comment:
   The error message explicitly called `map(_.sql)` instead of default 
`toString`. The `Alias.sql` is using `name` field which has already been 
formatted by `flatArguments` when constructing `Alias`. So this is also 
following the `flatArgument` framework.
   As the error message is intended to suggest user with a sql snippet, maybe 
it's better to not includ `#exprId` anyway? Thanks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to