wud-if opened a new issue, #13741:
URL: https://github.com/apache/gluten/issues/13741

   ### Description
   
   ### Motivation
   
   Gluten-flink (GFV) has no offload path for window joins today: a query 
joining two windowed TVF outputs falls back to the JVM `WindowJoinOperator`, 
and the HOP/SESSION window table functions themselves run through the JVM 
`WindowTableFunctionOperator`, which expands rows one at a time in Java. At 
scale this is not merely slow — on the nexmark benchmark (1e8 events, 8-way 
parallelism) the JVM TVF saturates the TaskManager until its heartbeat times 
out and the job fails, so window joins over HOP/SESSION cannot complete at all 
on large data.
   
   ### Proposal
   
   Offload the full window-join pipeline to velox, spanning three repos:
   
   - **velox** : a stateful `WindowJoin` operator over operator-owned keyed 
state — buckets keyed by (joinKey, windowEnd namespace), watermark-driven 
firing with a due-index, late-row drop, and a fast path for INNER joins with a 
tautological probe condition (zero-copy dictionary cross-product instead of the 
NestedLoopJoinProbe). Two new stateless/stateful TVF operators: `HopExpand` 
(dictionary replication, K = size/slide copies per row with flat integer window 
columns) and `SessionExpand` (sorted gap-chain sweep into disjoint sessions, 
watermark-triggered emission). Includes an upstream fix in 
`NestedLoopJoinProbe::getOutput()` that dropped remaining probe rows of a 
partially consumed multi-row batch.
   - **velox4j** : Java-side plan-node serde for `StreamWindowJoinNode` / 
`HopExpandNode` / `SessionExpandNode`, plus presto-frame serde for the stateful 
exchange so the whole chain stays off the RowData materialization path.
   - **gluten** (this repo): planner routing — `StreamExecWindowJoin` detects 
window bounds and drops tautological equi conditions to unlock the native fast 
path; `StreamExecWindowTableFunction` routes unit-size TUMBLE to a velox 
projection and aligned HOP/SESSION to the new expand operators.
   
   ### Performance (nexmark, 8-way parallelism, dual-engine)
   
   | Scale | Window | GFV | native Flink | Result |
   |---|---|---|---|---|
   | 1e7 | TUMBLE(1s) | 3.9 s | 7.3 s | GFV 1.9x faster |
   | 1e7 | HOP(slide 1s, size 2s) | 6.4 s | 8.5 s | GFV 1.3x faster |
   | 1e7 | SESSION(gap 1s) | 11.3 s | 19.0 s | GFV 1.7x faster |
   
   **Gluten version**: main branch (gluten-flink)
   
   ### Gluten version
   
   None


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