[SIG-45543] return microsecond rather than nanosec in arrowToRecord() for timestamp tz/ntz/ltz to avoid future date overflow #180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
snowflakedb#910
The last piece that blocks arrow batch.
It's the "Year 2262" problem.
The root cause is the int64, which is the underlying data representation of
arrow.Timestamp()
is unable to support date beyond 2262 in nanosecond.timestampNtzType
,timestampLtzType
,timestampTzType
from snowflake can return a future date that can't be represented by int64 in nanosecond.Since in Sigma system we use millisecond for now and there's microsecond WIP, we don't have any plans to support nanosecond. We can just transport microsecond in arrow batch to bypass this problem.
This only affects arrow batch path and doesn't have impact on production code.
I'll also make exporter/evaluator changes.
Question You Might Ask
Why we don't we use upstream fix?
There is no "real fix" to the problem. What upstream does is to add a validation check and return an error if overflow. However since we don't need nanosecond, we can return microsecond and bypass this year 2262 problem at all.
Checklist
make fmt
to fix inconsistent formatsmake lint
to get lint errors and fix all of them