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

Rowtype mismatch in DrillReduceAggregatesRule

    XMLWordPrintableJSON

Details

    Description

      It's work correct for example in case when there is only one aggregation:
      select col1, stddev(col2) FROM(values ('UA', 3), ('USA', 2), ('UA', 3), ('USA', 5), ('USA', 1), ('UA', 9)) x(col1, col2) GROUP BY col1 LIMIT 6;
      Or when it's after other aggregations:
      select col1, SUM(col2), stddev(col2) FROM (values ('UA', 3), ('USA', 2), ('UA', 3), ('USA', 5), ('USA', 1), ('UA', 9)) x(col1, col2) GROUP BY col1 LIMIT 6;
      But when we try to put it before an aggregation, like SUM:
      select col1, stddev(col2), SUM(col2) FROM (values ('UA', 3), ('USA', 2), ('UA', 3), ('USA', 5), ('USA', 1), ('UA', 9)) x(col1, col2) GROUP BY col1 LIMIT 6;
      It's failed with error:
      SYSTEM ERROR: AssertionError: Type mismatch:
      rowtype of new rel:
      RecordType(CHAR(3) NOT NULL col1, BIGINT $f1, BIGINT $f2, BIGINT NOT NULL $f3, BIGINT $f4) NOT NULL
      rowtype of set:
      RecordType(CHAR(3) NOT NULL col1, BIGINT $f1, BIGINT $f2, BIGINT NOT NULL $f3, BIGINT NOT NULL $f4) NOT NULL
      Same for stddev_samp

      Attachments

        Activity

          People

            leon_wtf wtf
            leon_wtf wtf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: