| # testExactCountDistinctWithGroupingAndOtherAggregators case-crc:f03f8870 |
| # quidem testcase reason: AGG_COL_EXCHANGE |
| !set debug true |
| !set defaultTimeout 300000 |
| !set maxScatterGatherBytes 9223372036854775807 |
| !set plannerStrategy DECOUPLED |
| !set sqlCurrentTimestamp 2000-01-01T00:00:00Z |
| !set sqlQueryId dummy |
| !set useApproximateCountDistinct false |
| !set outputformat mysql |
| !use druidtest:/// |
| SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; |
| +------+--------+--------+ |
| | dim2 | EXPR$1 | EXPR$2 | |
| +------+--------+--------+ |
| | | 1 | 1 | |
| | a | 2 | 2 | |
| | abc | 1 | 1 | |
| | | 2 | 2 | |
| +------+--------+--------+ |
| (4 rows) |
| |
| !ok |
| LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) |
| LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) |
| LogicalTableScan(table=[[druid, foo]]) |
| |
| !logicalPlan |
| DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) |
| DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) |
| DruidTableScan(table=[[druid, foo]], druid=[logical]) |
| |
| !druidPlan |
| { |
| "queryType" : "groupBy", |
| "dataSource" : { |
| "type" : "query", |
| "query" : { |
| "queryType" : "groupBy", |
| "dataSource" : { |
| "type" : "table", |
| "name" : "foo" |
| }, |
| "intervals" : { |
| "type" : "intervals", |
| "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] |
| }, |
| "granularity" : { |
| "type" : "all" |
| }, |
| "dimensions" : [ { |
| "type" : "default", |
| "dimension" : "dim1", |
| "outputName" : "d0", |
| "outputType" : "STRING" |
| }, { |
| "type" : "default", |
| "dimension" : "dim2", |
| "outputName" : "d1", |
| "outputType" : "STRING" |
| } ], |
| "aggregations" : [ { |
| "type" : "longSum", |
| "name" : "a0", |
| "fieldName" : "cnt" |
| } ], |
| "limitSpec" : { |
| "type" : "NoopLimitSpec" |
| } |
| } |
| }, |
| "intervals" : { |
| "type" : "intervals", |
| "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] |
| }, |
| "granularity" : { |
| "type" : "all" |
| }, |
| "dimensions" : [ { |
| "type" : "default", |
| "dimension" : "d1", |
| "outputName" : "_d0", |
| "outputType" : "STRING" |
| } ], |
| "aggregations" : [ { |
| "type" : "longSum", |
| "name" : "_a0", |
| "fieldName" : "a0" |
| }, { |
| "type" : "filtered", |
| "aggregator" : { |
| "type" : "count", |
| "name" : "_a1" |
| }, |
| "filter" : { |
| "type" : "not", |
| "field" : { |
| "type" : "null", |
| "column" : "d0" |
| } |
| }, |
| "name" : "_a1" |
| } ], |
| "limitSpec" : { |
| "type" : "NoopLimitSpec" |
| } |
| } |
| !nativePlan |