yashmayya opened a new pull request, #18311:
URL: https://github.com/apache/pinot/pull/18311
## Summary
`fromDateTime()` currently throws `IllegalInstantException` when the parsed
local wall-clock time doesn't exist in the target timezone because of a DST
spring-forward. Example: `fromDateTime('2026-04-24', 'yyyy-MM-dd',
'Africa/Cairo')` — midnight in Cairo doesn't exist on that date because the
clock jumps 00:00 → 01:00. Trino / Spark / BigQuery silently shift forward past
the gap; this change aligns Pinot with that behavior.
The fix parses strictly first (preserving behavior for all currently-working
inputs) and, on `IllegalInstantException` only, re-parses the wall-clock time
in UTC and uses `DateTimeZone.convertLocalToUTC(..., strict=false)` to shift
forward to the next valid instant. All other parse errors (unparseable input,
out-of-range fields) still surface as before.
Note: the 4-arg `fromDateTime(ts, pattern, tz, defaultVal)` overload
previously returned `defaultVal` on DST-gap inputs; it now returns the resolved
instant.
## Test plan
- [ ] `DateTimePatternHandlerTest` — 11 unit tests covering Eastern/Western
hemisphere gaps, half-hour DST (Lord Howe), the `defaultVal` overload, an
explicit-offset-token regression guard, parsed-zone-in-gap propagation, and
non-gap / UTC sanity checks.
- [ ] `DateTimeFunctionsTest` — scalar-level coverage through
`InbuiltFunctionEvaluator`.
--
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]