Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7348

Aggregate on Subquery with Select Distinct or UNION fails to Group By

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.15.0
    • Fix Version/s: None
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      The following query fails to group properly.

      SELECT date, COUNT(1)
      FROM (
          SELECT DISTINCT
              id,
              date,
              status
          FROM table(dfs.`path`(type => 'text', fieldDelimiter => ',', extractHeader => TRUE))
      )
      GROUP BY 1

      This also fails to group properly.

      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
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              snapdoodle Keith G Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: