You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `sales` (
`year` int DEFAULT NULL,
`country` varchar(20) DEFAULT NULL,
`product` varchar(32) DEFAULT NULL,
`profit` int DEFAULT NULL
)
alter table sales set tiflash replica 1
explain SELECT year+2 as y, SUM(profit) AS profit FROM sales GROUP BY year+2, year+profit WITH ROLLUP having y > 2002 order by year+2, profit;
As you see having item y is referenced to select item (year + 2) referenced to a grouping set expression (year + 2). And after Expand OP, grouping set expression (year + 2) is changed as column#6 with nullability change, which means it's not the original (year+2) / column#6 any more. Therefore (year +2) > 2002 shouldn't be pushed down through Expand, otherwise, additional NULL value in position of grouping set expression (year + 2) will be generated and remained later.
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
As you see having item y is referenced to select item (year + 2) referenced to a grouping set expression (year + 2). And after Expand OP, grouping set expression (year + 2) is changed as column#6 with nullability change, which means it's not the original (year+2) / column#6 any more. Therefore (year +2) > 2002 shouldn't be pushed down through Expand, otherwise, additional NULL value in position of grouping set expression (year + 2) will be generated and remained later.
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: