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

Khurram Faraaz updated DRILL-3676:
----------------------------------
    Assignee: Sean Hsuan-Yi Chu

> Group by ordinal number of an output column results in parse error
> ------------------------------------------------------------------
>
>                 Key: DRILL-3676
>                 URL: https://issues.apache.org/jira/browse/DRILL-3676
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.2.0
>            Reporter: Khurram Faraaz
>            Assignee: Sean Hsuan-Yi Chu
>             Fix For: Future
>
>
> Group by number results in parse error.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select sub_q.col1 from (select col1 from 
> FEWRWSPQQ_101) sub_q group by 1;
> Error: PARSE ERROR: At line 1, column 8: Expression 'q.col1' is not being 
> grouped
> [Error Id: 0eedafd9-372e-4610-b7a8-d97e26458d58 on centos-02.qa.lab:31010] 
> (state=,code=0)
> {code}
> When we use the column name instead of the number, the query compiles and 
> returns results.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select col1 from (select col1 from 
> FEWRWSPQQ_101) group by col1;
> +----------------------+
> |         col1         |
> +----------------------+
> | 65534                |
> | 10000000             |
> | -1                   |
> | 0                    |
> | 1                    |
> | 13                   |
> | 17                   |
> | 23                   |
> | 1000                 |
> | 9999999              |
> | 30                   |
> | 25                   |
> | 1001                 |
> | -65535               |
> | 5000                 |
> | 3000                 |
> | 200                  |
> | 197                  |
> | 4611686018427387903  |
> | 9223372036854775806  |
> | 9223372036854775807  |
> | 92233720385475807    |
> +----------------------+
> 22 rows selected (0.218 seconds)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select sub_query.col1 from (select col1 from 
> FEWRWSPQQ_101) sub_query group by sub_query.col1;
> +----------------------+
> |         col1         |
> +----------------------+
> | 65534                |
> | 10000000             |
> | -1                   |
> | 0                    |
> | 1                    |
> | 13                   |
> | 17                   |
> | 23                   |
> | 1000                 |
> | 9999999              |
> | 30                   |
> | 25                   |
> | 1001                 |
> | -65535               |
> | 5000                 |
> | 3000                 |
> | 200                  |
> | 197                  |
> | 4611686018427387903  |
> | 9223372036854775806  |
> | 9223372036854775807  |
> | 92233720385475807    |
> +----------------------+
> 22 rows selected (0.177 seconds)
> {code}



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

Reply via email to