cloud-fan commented on issue #23701: [SPARK-26741][SQL] Allow using aggregate 
expressions in ORDER BY clause
URL: https://github.com/apache/spark/pull/23701#issuecomment-459235128
 
 
   ```
   val df1 = spark.range(10).groupBy('id).agg(max('id) as 'm)
   val df2 = spark.range(10, 20).groupBy('id).agg(max('id) as 'm)
   val df = df1.unionAll(df2).orderBy(max('id))
   ```
   It seems to me we should fail this query. If we write this query in SQL, 
`select * from (... union ...) order by max(id)`, does this work in other 
databases?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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