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.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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