txwyy123 commented on PR #59841:
URL: https://github.com/apache/spark/pull/59841#issuecomment-6790046508
@LuciferYang Thank you for the detailed review. Pushed `863ef46b` addressing
all seven points:
**1. Conditional field-based path** — The field-based extraction now gates
on `totalOutputCols > conf.wholeStageMaxNumFields / 2`. Narrow joins stay on
local variables. Under default `maxFields=100`, a 50-column join stays on
locals; only wider joins (or raised `maxFields`) use the field path.
**2. Restored deferred column loading** — The condition path now partitions
per-column extraction snippets by `conditionForCodegen.references`:
condition-needed columns extract before the check, the rest load lazily after
the condition passes (via the `loaded` flag). Semi/anti/existence skip the
non-condition buffered columns entirely, matching the original behavior.
**3. EmptyBlock regression test** — Added `"wide SMJ with large CASE WHEN
compiles with EmptyBlock"`: an SMJ with no extra condition under a 2000-branch
`largeCaseWhen` inside `withSplitAlways`. This fails with `code""` and passes
with `EmptyBlock`.
**4. Dropped WideJoinBenchmark.scala** — Replaced with `"field-based
extraction keeps processNext under JIT limit"`: asserts
`maxStageMethodSize(joined) <= DEFAULT_JVM_HUGE_METHOD_LIMIT` on a 40+40 column
join.
**5. Fixed condition tests** — Both "extra join condition" tests now use
`(left("l_c0") + right("r_c0")) % 3 =!= 0`, which references both sides and
rejects ~1/3 of pairs. The left outer test verifies null-extended rows from
rejected matches. Added `assertSMJCodegenUsed` to the equi-only test.
**6. `JavaCode.global` / `isNullGlobal`** — Switched from
`JavaCode.variable`/`isNullVariable` to `JavaCode.global`/`isNullGlobal` in
both `genOneSideJoinVarsAsFields` and `createStreamedVarsAsFields`. All
policies now read the fields in place without passing them as parameters.
**7. Dead code** — `createStreamedVars` and `splitVarsByCondition` are live
again since the narrow-join path uses them. `genOneSideJoinVarsAsFields` now
returns per-column snippets (not pre-split code), so the caller controls
grouping.
--
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]