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

   ### What changes are proposed in this pull request?
   
   Fixes #13471 
   
   Maps the temporal string/number conversion expressions to their velox 
flinksql implementations (companion velox PR bigo-sg/velox#94):
   
   - `RexCallConverterFactory`: `TO_DATE` / `TO_TIMESTAMP` / `TO_TIMESTAMP_LTZ` 
entries — plain name mappings; both arities of the first two are covered by the 
flinksql signatures, `TO_TIMESTAMP_LTZ`'s numeric argument types bind through 
the same registration.
   - `RexNodeConverter`: `DATE` literals convert to the epoch-day 
`IntegerValue` — Flink folds constant `TO_DATE` calls in the planner, and the 
plan used to die at conversion with the DATE literal unsupported. 
`TIMESTAMP_WITH_LOCAL_TIME_ZONE` literals share the TIMESTAMP conversion body 
(`TimestampString.getMillisSinceEpoch` → boxed-`Long` millis, with a null 
guard), so folded `TO_TIMESTAMP` / `TO_TIMESTAMP_LTZ` literals reach velox. 
NULL literal branches emit a null variant (a velox4j serialization limitation 
currently drops typed NULL literals at the bridge; NULL rows arrive from data 
inputs instead).
   - `RexNodeConverter`: identity-cast elimination — the planner emits 
`CAST(literal AS T)` around every folded literal whose nullability differs from 
the sink's, and velox rejects same-type casts, so 
`isSameTypeIgnoringNullability` (recursive type equality ignoring nullability 
only; ANY never elided; composite component types must match) passes the 
operand through unchanged.
   - `RexNodeConverterTest`: covers the two literal channels, the identity-cast 
behavior across scalar and composite types, and the NULL literal branches.
   
   ### How was this patch tested?
   
   - Planner-level: `RexNodeConverterTest` — DATE literal converts to the 
epoch-day `IntegerValue`, LTZ literal to epoch millis; identity CAST elided on 
nullability-only casts for scalar and composite types (ARRAY/ROW/MAP casts with 
different component types stay real casts); NULL literal branches.
   - End-to-end dual-run on Flink 1.19.2: 32 SQL scenarios across the family — 
both arities, constant vs column formats, NULL propagation, literal folding for 
DATE and LTZ, invalid-input and out-of-range classes — with 29 exact matches 
and 3 shared job-failure classes (illegal format, year overflow, unsupported 
LTZ precision: identical failures on both stacks), zero mismatches.
   


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