add support for date and timestamp prior to 1/1/1970 #1401
Closed
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.
Rationale for this change
When we read date prior to 1st-Jan-1970 using parquet module, code panic by saying 'No such local time'. This bug exists because datatype date and timestamp in enum 'Field' (parquet/src/record/api.rs) is u32 and u64 which indicates the number of days from EPOCH DATE. In case of date being prior to 1/1/1970, number of days will be a negative integer that can't be hold by u32 and u64.
What changes are included in this PR?
Datatype of date and timestamp in Field enum is changed from u32 and u64 to i32 and i64 respectively.
Are there any user-facing changes?
No