KevinyhZou commented on code in PR #10320:
URL:
https://github.com/apache/incubator-gluten/pull/10320#discussion_r2283883078
##########
gluten-flink/planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecLocalWindowAggregate.java:
##########
@@ -157,30 +172,59 @@ protected Transformation<RowData> translateToPlanInternal(
io.github.zhztheplayer.velox4j.type.RowType outputType =
(io.github.zhztheplayer.velox4j.type.RowType)
LogicalTypeConverter.toVLType(getOutputType());
- List<FieldAccessTypedExpr> partitionKeys =
Utils.generateFieldAccesses(inputType, grouping);
- List<WindowFunction> functions =
AggregateCallConverter.toFunctions(aggCalls, inputType);
+ List<FieldAccessTypedExpr> groupingKeys =
Utils.generateFieldAccesses(inputType, grouping);
+ List<Aggregate> aggregates = AggregateCallConverter.toAggregates(aggCalls,
inputType);
checkArgument(outputType.getNames().size() >= grouping.length +
aggCalls.length);
- List<String> colNames =
+ List<String> aggNames =
outputType.getNames().stream()
.skip(grouping.length)
.limit(aggCalls.length)
.collect(Collectors.toList());
- PlanNode window =
- new WindowNode(
+ List<Integer> keyIndexes =
Arrays.stream(grouping).boxed().collect(Collectors.toList());
+ PartitionFunctionSpec keySelectorSpec = new
HashPartitionFunctionSpec(inputType, keyIndexes);
+ // TODO: support more window types.
+ Tuple5<Long, Long, Long, Integer, Integer> windowSpecParams =
+ WindowUtils.extractWindowParameters(windowing);
+ long size = windowSpecParams.f0;
+ long slide = windowSpecParams.f1;
+ long offset = windowSpecParams.f2;
+ int rowtimeIndex = windowSpecParams.f3;
+ int windowType = windowSpecParams.f4;
+ PartitionFunctionSpec sliceAssignerSpec =
+ new WindowPartitionFunctionSpec(inputType, rowtimeIndex, size, slide,
offset, windowType);
Review Comment:
It seems the `WindowPartitionFunctionSpec` is newly added in `bigo-sg`
velox,and it’s specifically for flink to divide the window into different
slices,and spark window does not need this. and I think it is better to use
some name that can be identified as flink specific. @PHILO-HE @shuai-xu
--
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]