ggjh-159 commented on code in PR #13558:
URL: https://github.com/apache/gluten/pull/13558#discussion_r4651539944
##########
gluten-flink/planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecGroupAggregate.java:
##########
@@ -198,13 +197,28 @@ protected Transformation<RowData> translateToPlanInternal(
.collect(Collectors.toList());
List<Integer> keyIndexes =
Arrays.stream(grouping).boxed().collect(Collectors.toList());
PartitionFunctionSpec keySelectorSpec = new
HashPartitionFunctionSpec(inputType, keyIndexes);
+ KeyedStateSpec keyedStateSpec =
+ new KeyedStateSpec(
+ keyIndexes,
+ keyIndexes.stream()
+ .map(keyIndex -> inputType.getChildren().get(keyIndex))
+ .collect(Collectors.toList()));
PlanNode aggsHandlerNode =
new GroupAggsHandlerNode(
- PlanNodeIdGenerator.newId(), outputType, generateUpdateBefore,
needRetraction);
+ PlanNodeIdGenerator.newId(),
+ inputType,
+ outputType,
+ aggregates,
+ generateUpdateBefore,
+ needRetraction);
// TODO: velox agg may not equal to flink
PlanNode aggregation =
new GroupAggregationNode(
Review Comment:
Thanks — failing at plan time is the right call; done in this PR. The native
keyed state has no expiry bookkeeping yet, and silently ignoring a TTL would
let state grow without bound, so StreamExecGroupAggregate now rejects a plan
whose state retention config is non-zero ('table.exec.state.ttl' or the
STATE_TTL hint) with a message saying exactly that. The default 0 (never clean
up) matches the native behavior and keeps working. Pinned by
GroupAggregateGuardTest#testStateTtlRejectedAtPlanTime. Passing the retention
time into the native backend is left as a TODO until velox supports expiry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]