-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[ESQL] Support autocasting to resolve types between nanosecond dates and millisecond dates #110009
Copy link
Copy link
Closed
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Description
Discussion ticket for how mixed operations between millisecond dates and nanosecond dates should work. This behavior would cover binary comparisons and arithmetic operations between mixed millisecond and nanosecond dates, and possibly some functions (TBD). This is complicated, and getting it wrong potentially obligates us to support a bad choice for a long time in BWC.
Option 1 - cast to millisecond date automatically
- This has the benefit that it will never overflow, but it loses precision. Effectively, equality becomes a range operation
- Changing this down the road would be a breaking change
Option 2 - Cast to nanosecond date automatically
- This can overflow, so an otherwise sensible comparison might just start returning nulls
- Equality gets weird, since we'll just be multiplying the milliseconds by 1,000,000 so for the vast majority of nanosecond values they will never be equal.
- Changing this down the road would be a breaking change
Option 3 - Don't auto cast anything, make the user pick the behavior they want
- Explicit is better than implicit (i.e. Zen of Python compliant)
- We could later add a default cast without it being breaking, as the explicit casts would still work
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancementTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Type
Fields
Give feedbackNo fields configured for issues without a type.