GH-50915: [FORMAT] Allow TIMESTAMP logical type to annotate FIXED_LEN_BYTE_ARRAY(12) - #50916
GH-50915: [FORMAT] Allow TIMESTAMP logical type to annotate FIXED_LEN_BYTE_ARRAY(12)#50916divjotarora wants to merge 8 commits into
Conversation
|
|
emkornfield
left a comment
There was a problem hiding this comment.
Some questions and comments I think the biggest one is scope and whether we should have an option to convert this value to a proper arrow type. Wemight also want to make it configurable the target of the arrow type
emkornfield
left a comment
There was a problem hiding this comment.
I think the conversion code always assumes a 1:1 mapping between arrow timestamp granularity and parquet granularity. I think in the common path when schema is inferred this is workable, but IIRC users can also supply there own schema (we should add test coverage for this path).
There doesn't seem to be an API at this level to supply a custom schema. The Arrow timestamp unit is derived from the Parquet logical type during schema conversion and that's passed down to the data converters. Based on this, I don't think any scaling is needed in this PR. To ensure correctness, I added a defensive check that fails the conversion if the Arrow and Parquet units differ. |
emkornfield
left a comment
There was a problem hiding this comment.
one more thing to look at. I need to double check if there is a better idiom to express the conversion we want to do here, but we should at least look at using the visitor.
emkornfield
left a comment
There was a problem hiding this comment.
LGTM, just one more missing test case I think.
|
@divjotarora looks like parquet-reader-test is failing (didn't look at root cause) |
|
@emkornfield The new FLBA 12 timestamp test is failing, but it's due to: AFAICT this is expected as the test is referencing a parquet-testing file that's not merged in. I think this will pass once we merge apache/parquet-testing#123 and update the submodule hash in this repo. I've verified that it passes locally be overriding |
emkornfield
left a comment
There was a problem hiding this comment.
Changes look reasonable we can fix CI once vote passes and artifacts are merged.
Rationale for this change
See apache/parquet-format#600 for rationale.
What changes are included in this PR?
This PR adds support for using
TimestampTypeto annotateFIXED_LEN_BYTE_ARRAY(12)values.Are these changes tested?
Yes, via unit tests and an e2e test that reads the file added in parquet-testing (apache/parquet-testing#123).
Are there any user-facing changes?
No