wud-if opened a new issue, #13369: URL: https://github.com/apache/gluten/issues/13369
### Description ### Motivation `IFNULL(a, b)` — Flink's two-argument coalesce — is a very common null-handling expression in Flink SQL (the concise fallback form of `COALESCE` for a single nullable column). Today gluten-flink does not map it, so any query projecting `IFNULL(...)` fails function offload with `Function not supported: IFNULL`, and the whole Calc stays on the native path. It is also one of the expressions listed in #12210. ### Proposal Offload `IFNULL` to the velox flinksql function set: - velox side: an `ifnull` function under `velox/functions/flinksql/` with custom null handling (`callNullable`): non-null first argument wins, otherwise `b`, null when both are null. Flink's planner coerces both operands to their common type before the call, so same-typed signatures (`T, T -> T`) over boolean / tinyint..bigint / float / double / varchar / date / timestamp plus generic short/long decimal bindings cover the function. - planner side: map the `IFNULL` RexCall to `ifnull` (plain name mapping). Requires typed-null-literal support in `RexNodeConverter` for `IFNULL(x, CAST(NULL AS ...))` shapes, which in turn needs the velox variant serde to treat an absent `"value"` member as the typed null (velox4j serializes with `Include.NON_NULL`). - Semantics to preserve: non-null `a` → `a`; null `a` → `b`; both null → null; result type is the coerced common type of both arguments. Companion PRs: velox (function implementation) and gluten (mapping + null literals), both referencing this issue. ### Gluten version main branch -- 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]
