wud-if opened a new pull request, #13375:
URL: https://github.com/apache/gluten/pull/13375

   ### What changes are proposed in this pull request?
   
   Adds the planner-side wiring so Flink's `IFNULL(a, b)` offloads to the velox 
flinksql `ifnull` function (bigo-sg/velox#82> adds the function itself):
   
   - `RexCallConverterFactory`: map the `IFNULL` RexCall to `ifnull` via the 
default name converter. Flink's planner coerces both operands to their common 
type before the call, so a plain name mapping suffices.
   - `RexNodeConverter`: typed null-literal support — `CAST(NULL AS X)` folds 
to a null `RexLiteral`, which previously NPE'd in `toVariant`. A null literal 
now converts to a single null-accepting variant carrier; the velox-side serde 
(companion velox PR) reads the absent `"value"` member as the typed null. This 
is required for `IFNULL(x, CAST(NULL AS ...))` shapes and null constants in 
offloaded calcs in general.
   
   ### How was this patch tested?
   
   - `gluten-flink/ut`: `RexNodeConverterTest` null-literal cases (six SQL 
types plus decimal) and `IfNullFunctionsTest` execution tests (null three-state 
across STRING/BIGINT/DOUBLE/DECIMAL, null-literal first arg, both null) pass.
   - End-to-end dual-run on Flink 1.19.2 (native vs gluten-offloaded, identical 
VALUES inputs, changelog multiset exact comparison): the IFNULL case matches 
native exactly; the full 11-case expression suite passes.


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