Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
When we parse a SQL:
select COUNT(1) from T tumble(rowtime, interval 2 seconds)
In RexBuild.addAggCall will do the optimize as follows:
if(aggCall.getAggregation() instanceof SqlCountAggFunction && !aggCall.isDistinct()) { List rex = aggCall.getArgList(); List index = nullableArgs(rex, aggArgTypes); if(!index.equals(rex)) { aggCall = aggCall.copy(index, aggCall.filterArg); } }
After the code logic above, the COUNT(1) -> COUNT().
But when we parser a SQL:
select COUNT(1) OVER(...) from T.
we do not do the optimized the parameter. So in this JIRA. want add optimize for OVER constant parameter.
Attachments
Issue Links
- is related to
-
CALCITE-2132 Unify rewrites for aggregate functions and windowed aggregate functions
- Open