maropu edited a comment on issue #26420: [SPARK-27986][SQL] Support ANSI SQL 
filter predicate for aggregate expression.
URL: https://github.com/apache/spark/pull/26420#issuecomment-553785466
 
 
   I did quick reviews and left some comments, so could you check my comments 
above?
   Also, can you check the query below?
   ```
   //PgSQL
   postgres=# select * from t;
    k | v1 | v2 
   ---+----+----
    1 |  1 |  1
    2 |  2 |  2
   (2 rows)
   
   postgres=# select k, sum(v1) filter (where v1 > (select 1)), avg(v2) from t 
group by k;
    k | sum |          avg           
   ---+-----+------------------------
    2 |   2 |     2.0000000000000000
    1 |     | 1.00000000000000000000
   (2 rows)
   
   // This pr
   scala> sql("select k, sum(v1) filter (where v1 > (select 1)), avg(v2) from t 
group by k").show()
   19/11/14 16:48:15 ERROR Executor: Exception in task 1.0 in stage 13.0 (TID 
207)
   java.io.InvalidClassException: 
org.apache.spark.sql.catalyst.expressions.ScalarSubquery; no valid constructor
        at 
java.io.ObjectStreamClass$ExceptionInfo.newInvalidClassException(ObjectStreamClass.java:169)
        at 
java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:874)
        at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2043)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2211)
        at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream
   
   ```
   I personally think we need to consider more about the exact BNF grammar for 
aggregate filters that we will support in this pr. 

----------------------------------------------------------------
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