[
https://issues.apache.org/jira/browse/CALCITE-4983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ziwei Liu updated CALCITE-4983:
-------------------------------
Description:
In method unifyAggregates, if agg using grouping sets, doesn't handle the
condition need to pull up.
Here is the code:
{code:java}
if (targetGroupGenAggCalls.isEmpty()) {
List<RexNode> compenProjs = MutableRels.createProjectExprs(target, projects);
RexProgram compenRexProgram = RexProgram.create(
target.rowType, compenProjs, targetCond, query.rowType, rexBuilder);
result = MutableCalc.of(target, compenRexProgram);
} else {
// here has a problem: doesn't handle the targetCond
result = MutableAggregate.of(target,
target.groupSet, target.groupSets, targetGroupGenAggCalls);
} {code}
was:
In method unifyAggregates, if agg using grouping sets and there has condition
need to pull up.
Here is the code:
{code:java}
if (targetGroupGenAggCalls.isEmpty()) {
List<RexNode> compenProjs = MutableRels.createProjectExprs(target, projects);
RexProgram compenRexProgram = RexProgram.create(
target.rowType, compenProjs, targetCond, query.rowType, rexBuilder);
result = MutableCalc.of(target, compenRexProgram);
} else {
// here has a problem: doesn't handle the targetCond
result = MutableAggregate.of(target,
target.groupSet, target.groupSets, targetGroupGenAggCalls);
} {code}
> In SubstitutionVisitor, handle condition when unify Aggregate.
> --------------------------------------------------------------
>
> Key: CALCITE-4983
> URL: https://issues.apache.org/jira/browse/CALCITE-4983
> Project: Calcite
> Issue Type: Bug
> Reporter: Ziwei Liu
> Assignee: Ziwei Liu
> Priority: Major
>
> In method unifyAggregates, if agg using grouping sets, doesn't handle the
> condition need to pull up.
> Here is the code:
> {code:java}
> if (targetGroupGenAggCalls.isEmpty()) {
> List<RexNode> compenProjs = MutableRels.createProjectExprs(target,
> projects);
> RexProgram compenRexProgram = RexProgram.create(
> target.rowType, compenProjs, targetCond, query.rowType, rexBuilder);
> result = MutableCalc.of(target, compenRexProgram);
> } else {
> // here has a problem: doesn't handle the targetCond
> result = MutableAggregate.of(target,
> target.groupSet, target.groupSets, targetGroupGenAggCalls);
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)