Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Support reading int96 as timestamp #506

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chelseajonesr
Copy link

By default Spark writes parquet files with int96 timestamps, even though the type has been deprecated for a while. There are details of the format and some discussion here:
apache/parquet-format#49

This PR adds support for reading int96 values into timestamps. (Just reading, not writing.)

During implementation I found that the convertToType() function in convert.go was converting in the wrong direction. I've added a test scenario "string to int" in convert_test.go which fails with the existing code and succeeds with the updated version.
Also, converting types with null values failed in some situations, so I added null checks to the ConvertValue functions in type.go and added the "nils" scenario in convert_test.go.

@kevinburkesegment
Copy link
Contributor

Apologies to make more work for you, but we've decided to move development on this project to a new organization at https://github.com/parquet-go/parquet-go to ensure its long term success. We appreciate your contribution and would appreciate if you could reopen this PR there if it is still relevant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants