Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Problem description:
When rollup or cube expressions are specified as input to grouping_sets ,then instead of handling the rollup or cube expression in LogicalAggregate operator they are handled in LogicalProject operator which is incorrect.
Basically grouping_sets with rollup/cube expressions as input is not flattened into logical aggregate operator.
Problem Test case:
create table temp11(a integer, b integer);
select a,b,count from temp11 group by grouping sets(rollup(a,b),a,b,());
Test Case output:
{
"rels": [
,
{
"id": "1",
"relOp": "LogicalProject",
"fields": [
"$f0",
"a",
"b"
],
"exprs": [
{
"op": "ROLLUP", <<--- Incorrect expressioin in LogicalProject operator.
"operands": [
,
]
},
,
]
},
{
"id": "2",
"relOp": "LogicalAggregate",
"group": [
0,
1,
2
],
"groups": [
[
0
],
[
1
],
[
2
],
[]
],
"aggs": [
{
"agg": "COUNT",
"type":
,
"distinct": false,
"operands": []
}
]
},
{
"id": "3",
"relOp": "LogicalProject",
"fields": [
"a",
"b",
"EXPR$2"
],
"exprs": [
,
,
]
}
]
}
Attachments
1.
|
Fix and test grouping sets issue | Closed | Julian Hyde |