Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for date and timestamp prior to 1/1/1970 #1401

Closed
wants to merge 2 commits into from

Conversation

amitagrawalcs
Copy link

@amitagrawalcs amitagrawalcs commented Mar 5, 2022

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

@github-actions github-actions bot added the parquet Changes to the parquet crate label Mar 5, 2022
@liukun4515
Copy link
Contributor

Thanks for your contributions. @amitagrawalcs
Can you add some tests for this fix?

@codecov-commenter
Copy link

Codecov Report

Merging #1401 (0cc40ca) into master (a7bd09a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1401      +/-   ##
==========================================
- Coverage   83.10%   83.09%   -0.01%     
==========================================
  Files         181      181              
  Lines       53244    53244              
==========================================
- Hits        44249    44244       -5     
- Misses       8995     9000       +5     
Impacted Files Coverage Δ
parquet/src/record/api.rs 91.65% <100.00%> (ø)
arrow/src/datatypes/datatype.rs 66.40% <0.00%> (-0.40%) ⬇️
arrow/src/datatypes/field.rs 53.79% <0.00%> (-0.31%) ⬇️
arrow/src/array/transform/mod.rs 86.20% <0.00%> (-0.23%) ⬇️
parquet/src/encodings/encoding.rs 93.52% <0.00%> (-0.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7bd09a...0cc40ca. Read the comment docs.

@alamb
Copy link
Contributor

alamb commented Mar 6, 2022

Also note the Integration test failure is fixed on master, so when you rebase or merge the next run should work

@alamb
Copy link
Contributor

alamb commented Mar 28, 2022

Hi @amitagrawalcs -- we are preparing for an arrow release this week -- will you have a chance to add some tests to this PR?

@alamb
Copy link
Contributor

alamb commented Apr 15, 2022

Marking as draft until tests are added. Please mark as ready to review when it is next ready

Thanks!

@alamb alamb marked this pull request as draft April 15, 2022 12:51
@tustvold
Copy link
Contributor

This PR has been inactive for a while so closing to clear the backlog, please feel free to reopen if you come back to this

@tustvold tustvold closed this Jan 15, 2023
@tustvold
Copy link
Contributor

It might also have been fixed by #3437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants