Keith G Yu created DRILL-7348:
---------------------------------

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


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
(v7.6.14#76016)

Reply via email to