TianJialong opened a new pull request, #13730:
URL: https://github.com/apache/gluten/pull/13730

   ## What changes are proposed in this pull request?
   Fixes https://github.com/apache/gluten/issues/13724 (companion velox PR 
https://github.com/bigo-sg/velox/pull/105, velox4j PR 
https://github.com/bigo-sg/velox4j/pull/83):
   
   This PR wires Flink's legacy group window aggregation (`GROUP BY k, 
SESSION/TUMBLE/HOP(time, ...)`, planner node `StreamExecGroupWindowAggregate`) 
to the Velox native backend for all three time-window kinds: the planner builds 
the window aggregation plan nodes (aggregate handler node + window aggregation 
node with a `KeyedStateSpec` and the window-kind parameters), and the runtime 
carries them in a Velox-executing one-input operator.
   
   - `StreamExecGroupWindowAggregate.translateToPlanInternal` (gluten-specific 
section rewritten):
     - Builds `GroupWindowAggsHandlerNode` (aggregates + `countStarIndex`) and 
`GroupWindowAggregationNode` (key channels/types, window type/gap, allowed 
lateness, produce-updates, window start/end output indices) and wraps them in a 
`StatefulPlanNode` carried by `GlutenWindowOneInputOperator`.
     - The transformation stays non-keyed by design: the user key rides the 
plan's `KeyedStateSpec` into the Velox keyed state backend, and a Flink-side 
state key selector would wrongly put the transformation into keyed state — the 
old override's keyed declaration is removed.
     - Fails loud (`VELOX_UNSUPPORTED` / `IllegalArgumentException`) with zero 
output on the out-of-scope faces: row-count windows, advanced EMIT strategies 
(early-fire/late-fire, non-zero allowed lateness, produce-updates), and 
processing-time windows.
     - The two index helpers (`windowStartIndex`/`windowEndIndex`) document the 
cross-repo contract: the native emit loop fills the trailing time-attribute 
columns in the fixed planner order [start, end, rowtime, proctime] (rowtime = 
window maxTimestamp, proctime = NULL), so any change in the Flink 
window-property order must be synchronized with the Velox emit loop.
   - New `GlutenWindowOneInputOperator` (a `WindowAggOperator` subclass): 
clone-preserving override (the offload chain would otherwise strip the subclass 
and silently drop its behaviors), resolution-based RocksDB rejection (fails 
loud during task initialization, keeping the HEAP backend as the supported 
path), and `snapshotState` union-list checkpointing to keep operator chain 
state consistent.
   - `gluten-flink/ut/pom.xml`: two test-scope dependencies 
(flink-statebackend-rocksdb, flink-runtime) as compile prerequisites for the 
new test classes.
   
   This PR also carries the changes from 
ggjh-159/gluten@7684fb098df27880b6d394923387aef25c053d33 ([FLINK][VL] Pass 
serialized vectors as byte[] in GlutenStatefulRecordSerializer: the 
network-edge vector serde switches from base64 String to raw byte[] once 
velox4j's JNI contract goes byte[]).
   
   ## How was this patch tested?
   
   - New unit tests, all passing (9 cases):
     - `StreamExecGroupWindowAggregateWindowAggTest` (6): the transformation 
stays non-keyed (null key selector/type, operator is the subclass), a positive 
translation case for each window kind (SESSION / TUMBLE / HOP plan through to 
the velox node), and negative coverage for the fail-loud faces (row-count 
windows, early-fire, allow-lateness, processing-time).
     - `GlutenWindowOneInputOperatorTest` (3): the two RocksDB rejection routes 
(job-config / app backend) and clone preservation.
   - End-to-end dual-run against native Flink 1.19.2 with fixed file inputs and 
print sinks: all three window kinds — SESSION (025 at parallelism 1 and 4, plus 
nexmark q11 at full scale: 95834 input bids, 2046 output rows), TUMBLE (023, 6 
windows), and HOP (026, size 10s / slide 5s, 18 overlapping windows each 
accumulating independently) — reached FINISHED on both engines with 
changelog-folded final result sets matching exactly; the key-routing invariant 
(same key → same subtask at parallelism 4) held with zero violations on both 
engines.


-- 
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]

Reply via email to