blob: e4c98567392d03027ce4d4a99d4440dc2378eead [file]
# testUnionAllQueries case-crc:c3323b00
# quidem testcase reason: UNION_ALL_QUERY
!set debug true
!set defaultTimeout 300000
!set maxScatterGatherBytes 9223372036854775807
!set plannerStrategy DECOUPLED
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
!set sqlQueryId dummy
!set outputformat mysql
!use druidtest:///
SELECT COUNT(*) FROM foo UNION ALL SELECT SUM(cnt) FROM foo UNION ALL SELECT COUNT(*) FROM foo;
+--------+
| EXPR$0 |
+--------+
| 6 |
| 6 |
| 6 |
+--------+
(3 rows)
!ok
LogicalUnion(all=[true])
LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
LogicalTableScan(table=[[druid, foo]])
LogicalAggregate(group=[{}], EXPR$0=[SUM($4)])
LogicalTableScan(table=[[druid, foo]])
LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
LogicalTableScan(table=[[druid, foo]])
!logicalPlan
DruidUnion(all=[true])
DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical])
DruidTableScan(table=[[druid, foo]], druid=[logical])
DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical])
DruidTableScan(table=[[druid, foo]], druid=[logical])
DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical])
DruidTableScan(table=[[druid, foo]], druid=[logical])
!druidPlan
{
"queryType" : "scan",
"dataSource" : {
"type" : "query",
"query" : {
"queryType" : "union",
"queries" : [ {
"queryType" : "timeseries",
"dataSource" : {
"type" : "table",
"name" : "foo"
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"granularity" : {
"type" : "all"
},
"aggregations" : [ {
"type" : "count",
"name" : "a0"
} ],
"context" : {
"debug" : "true",
"defaultTimeout" : "300000",
"maxScatterGatherBytes" : "9223372036854775807",
"outputformat" : "MYSQL",
"plannerStrategy" : "DECOUPLED",
"sqlCurrentTimestamp" : "2000-01-01T00:00:00Z",
"sqlQueryId" : "dummy",
"sqlStringifyArrays" : false
}
}, {
"queryType" : "timeseries",
"dataSource" : {
"type" : "table",
"name" : "foo"
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"granularity" : {
"type" : "all"
},
"aggregations" : [ {
"type" : "longSum",
"name" : "a0",
"fieldName" : "cnt"
} ],
"context" : {
"debug" : "true",
"defaultTimeout" : "300000",
"maxScatterGatherBytes" : "9223372036854775807",
"outputformat" : "MYSQL",
"plannerStrategy" : "DECOUPLED",
"sqlCurrentTimestamp" : "2000-01-01T00:00:00Z",
"sqlQueryId" : "dummy",
"sqlStringifyArrays" : false
}
}, {
"queryType" : "timeseries",
"dataSource" : {
"type" : "table",
"name" : "foo"
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"granularity" : {
"type" : "all"
},
"aggregations" : [ {
"type" : "count",
"name" : "a0"
} ],
"context" : {
"debug" : "true",
"defaultTimeout" : "300000",
"maxScatterGatherBytes" : "9223372036854775807",
"outputformat" : "MYSQL",
"plannerStrategy" : "DECOUPLED",
"sqlCurrentTimestamp" : "2000-01-01T00:00:00Z",
"sqlQueryId" : "dummy",
"sqlStringifyArrays" : false
}
} ],
"context" : null
}
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"resultFormat" : "compactedList",
"columns" : [ "a0" ],
"columnTypes" : [ "LONG" ],
"granularity" : {
"type" : "all"
},
"legacy" : false
}
!nativePlan