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

Keith G Yu commented on DRILL-7348:
-----------------------------------

It is entirely possible the error was due to using a reserved keyword as a 
column name.  I had rewritten it for posting here but cannot recall whether 
`date` was originally in the column names.  Since I can't recall nor provide 
the original data source used thank everyone for their attention and I'll close 
the issue.

> Aggregate on Subquery with Select Distinct or UNION fails to Group By
> ---------------------------------------------------------------------
>
>                 Key: DRILL-7348
>                 URL: https://issues.apache.org/jira/browse/DRILL-7348
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.15.0
>            Reporter: Keith G Yu
>            Priority: Major
>
> The following query fails to group properly.
> {code:java}
> SELECT date, COUNT(1)
> FROM (
>     SELECT DISTINCT
>         id,
>         date,
>         status
>     FROM table(dfs.`path`(type => 'text', fieldDelimiter => ',', 
> extractHeader => TRUE))
> )
> GROUP BY 1{code}
> This also fails to group properly.
> {code:java}
> SELECT date, COUNT(1)
> FROM (
>     SELECT
>         id,
>         date,
>         status
>     FROM table(dfs.`path1`(type => 'text', fieldDelimiter => ',', 
> extractHeader => TRUE))
>     UNION
>     SELECT
>         id,
>         date,
>         status
>     FROM table(dfs.`path2`(type => 'text', fieldDelimiter => ',', 
> extractHeader => TRUE))
> )
> GROUP BY 1
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to