[ 
https://issues.apache.org/jira/browse/SPARK-18863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798578#comment-15798578
 ] 

Nattavut Sutyanyong commented on SPARK-18863:
---------------------------------------------

I made the conclusion too soon. It turns out that the scenario TC 01.12 is a 
variation of this problem in which we need to perform a {{CheckAnalysis}} on 
the subquery plan hanging of (currently limited to) a Filter operator. The 
original problem documented in the description is a subquery of the form of 
{{ScalarSubquery}} whereas TC 01.12 is of the form of {{PredicateSubquery}}.

I will close SPARK-19047 and submit a PR for this problem soon.

> Output non-aggregate expressions without GROUP BY in a subquery does not 
> yield an error 
> ----------------------------------------------------------------------------------------
>
>                 Key: SPARK-18863
>                 URL: https://issues.apache.org/jira/browse/SPARK-18863
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Nattavut Sutyanyong
>
> [~smilegator] has found that the following query does not raise a syntax 
> error (note the GROUP BY clause is commented out):
> {code:sql}
> SELECT pk, cv
> FROM   p, c
> WHERE  p.pk = c.ck
> AND    c.cv = (SELECT max(avg)
>                FROM   (SELECT   c1.cv, avg(c1.cv) avg
>                        FROM     c c1
>                        WHERE    c1.ck = p.pk
> --                       GROUP BY c1.cv
>                       ))
> {code}
> There could be multiple values of {{c1.cv}} for each value of {{avg(c1.cv)}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to