Skip to content

fix(partitioning): convert nano timestamp partition values to nanoseconds#3653

Open
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:fix/nano-timestamp-partition-representation
Open

fix(partitioning): convert nano timestamp partition values to nanoseconds#3653
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:fix/nano-timestamp-partition-representation

Conversation

@vishnuprakaz

Copy link
Copy Markdown
Contributor

Closes #3652

Rationale for this change

_to_partition_representation has no handler for TimestampNanoType / TimestamptzNanoType, so a datetime partition value
passes through unchanged instead of being converted to nanoseconds since epoch. The manifest writer expects an int there, so
identity-partitioned writes on timestamp_ns columns would fail once v3 writing lands (#1551).

This adds a handler for the two nano types, mirroring the existing microsecond one with datetime_to_nanos.

Happy to rework this or fold it into the v3 write effort if that's preferred.

Are these changes tested?

Yes, added unit tests covering datetime, int passthrough and None for both nano types, plus the same cases for the microsecond
types which weren't covered before.

Are there any user-facing changes?

No. Writing v3 tables is still gated, this just makes partitioned v3 writes work correctly once it's enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partition values for timestamp_ns columns are not converted to nanoseconds

1 participant