PHILO-HE commented on code in PR #10320:
URL:
https://github.com/apache/incubator-gluten/pull/10320#discussion_r2272672094
##########
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:
I note Flink's window is completely different from Spark SQL's. It would be
better to use a better name to easily distinguish in Velox4j and Velox, e.g.,
`StreamWindowPartitionFunctionSpec` looks better for clarity than
`WindowPartitionFunctionSpec`. cc @zhztheplayer
--
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]