GH-50915: [FORMAT] Allow TIMESTAMP logical type to annotate FIXED_LEN_BYTE_ARRAY(12) - #50916
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. |
8a903bd to
97f5a0d
Compare
|
@github-actions crossbow submit |
|
|
CI is green and changes look reasonale to me. I'll plan to merge Monday unless there are additional concerns raised. |
|
Thanks for the feedback @pitrou, this is ready for another look |
pitrou
left a comment
There was a problem hiding this comment.
LGTM now, thank you @divjotarora !
|
@github-actions crossbow submit -g cpp |
|
Revision: ad03173 Submitted crossbow builds: ursacomputing/crossbow @ actions-183bfb69cc |
|
@emkornfield @pitrou The failure in C GLib & Ruby / ARM64 macOS GLib & Ruby (pull_request) seem to be unrelated to my changes, is this expected? |
I would not say it's "expected" but you are certainly not responsible for it :) No worries! |
|
The 32-bit build above is green ( |
|
Gasp, I forgot to replace the |
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. It also adds functionality to convert FLBA(12) values to Arrow INT64 timestamps with the following flags/logic to handle overflow:convert_flba_timestampsproperty (default true). If false, conversion fails regardless of value.flba_timestamp_clamp_on_overflowproperty (default false) is consulted. If false, conversion fails. If true, the value is clamped to min/max int64.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