sunshone opened a new issue, #13469:
URL: https://github.com/apache/gluten/issues/13469

   ### Description
   
   **Description**:
   
   **Motivation**
   
   CURRENT_TIMESTAMP, NOW, LOCALTIMESTAMP and LOCALTIME are the 
session-timezone temporal expressions of Flink SQL. Today gluten-flink maps 
none of them, so any query projecting or filtering on them fails function 
offload ("Function not supported") and stays on the native path.
   
   **Proposal**
   
   Offload them to the velox flinksql function set:
   
   - **velox side (companion PR)**: implementations under 
`velox/functions/flinksql/` — `current_timestamp` / `now` (one struct, dual 
names): per-record `Timestamp::now()` with `is_deterministic = false`, so 
Flink's per-record evaluation in streaming mode is never constant-folded. 
`localtimestamp`: per-record `Timestamp::now().toTimezone(sessionTz)` — 
DST-aware per record, mechanism-matched to Flink streaming's per-record `now + 
sessionTimeZone.getOffset(now)`. `localtime`: the millisecond-of-day INTEGER — 
the same encoding Flink RowData uses for TIME (velox has no TIME type) — 
per-record in the session timezone.
   - **planner side (this repo)**: plain name mappings in 
`RexCallConverterFactory` — `CURRENT_TIMESTAMP` → `current_timestamp`, `NOW` → 
`now`, `LOCALTIMESTAMP` → `localtimestamp`, `LOCALTIME` → `localtime`. 
`LogicalTypeConverter` maps `TimeType` onto velox INTEGER (the physical 
encoding alignment — TIME columns cross the bridge unchanged).
   - **Semantics to preserve**: per-record evaluation in streaming mode (no 
constant folding), session-timezone resolution (DST-aware), the millisecond 
precision ceiling, null propagation. `LOCALTIME`'s raw projection surfaces the 
carrier int where native Flink renders `HH:mm:ss` — an output-form divergence 
ruled as tolerable by the downstream integration (the millisecond-of-day values 
are verified correct).
   
   **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