You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nattavut Sutyanyong (JIRA)" <ji...@apache.org> on 2016/12/14 16:02:58 UTC
[jira] [Updated] (SPARK-18863) Output non-aggregate expression
without a GROUP BY clause in a subquery does not yield a syntax error
[ https://issues.apache.org/jira/browse/SPARK-18863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nattavut Sutyanyong updated SPARK-18863:
----------------------------------------
Description:
[~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)}}.
was:
[~smilegator] has found that the following query does not raise a syntax error (note the GROUP BY clause is commented out):
{{code}}
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).
> Output non-aggregate expression without a GROUP BY clause in a subquery does not yield a syntax 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
> Priority: Minor
>
> [~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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org