You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/31 06:46:49 UTC

[GitHub] cloud-fan commented on issue #23701: [SPARK-26741][SQL] Allow using aggregate expressions in ORDER BY clause

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org