You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Cheng Lian (JIRA)" <ji...@apache.org> on 2016/03/18 10:01:33 UTC

[jira] [Resolved] (SPARK-14002) SQLBuilder should add subquery to Aggregate child when necessary

     [ https://issues.apache.org/jira/browse/SPARK-14002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheng Lian resolved SPARK-14002.
--------------------------------
       Resolution: Duplicate
    Fix Version/s: 2.0.0

This issue is actually covered by SPARK-13976.

> SQLBuilder should add subquery to Aggregate child when necessary
> ----------------------------------------------------------------
>
>                 Key: SPARK-14002
>                 URL: https://issues.apache.org/jira/browse/SPARK-14002
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Cheng Lian
>            Assignee: Cheng Lian
>             Fix For: 2.0.0
>
>
> Adding the following test case to {{LogicalPlanToSQLSuite}} to reproduce this issue:
> {code}
>   test("bug") {
>     checkHiveQl(
>       """SELECT COUNT(id)
>         |FROM
>         |(
>         |  SELECT id FROM t0
>         |) subq
>       """.stripMargin
>     )
>   }
> {code}
> Generated wrong SQL is:
> {code:sql}
> SELECT `gen_attr_46` AS `count(id)`
> FROM
> (
>     SELECT count(`gen_attr_45`) AS `gen_attr_46`
>     FROM
>         SELECT `gen_attr_45`                -- 
>         FROM                                --
>         (                                   -- A subquery
>             SELECT `id` AS `gen_attr_45`    -- is missing
>             FROM `default`.`t0`             --
>         ) AS gen_subquery_0                 --
> ) AS gen_subquery_1
> {code}



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