-
Notifications
You must be signed in to change notification settings - Fork 412
V3: Fix invalid downcasting for nanos #2397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tests/io/test_pyarrow.py
Outdated
|
|
||
| @pytest.mark.parametrize("format_version", [1, 2, 3]) | ||
| def test_task_to_record_batches_nanos(format_version: TableVersion, tmpdir: str) -> None: | ||
| from datetime import datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this import seems unnecessary now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one, I expected the linter to clean that up 🚀
rambleraptor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small question, but looks good to me otherwise.
| self._bound_row_filter = bind(table_metadata.schema(), row_filter, case_sensitive=case_sensitive) | ||
| self._case_sensitive = case_sensitive | ||
| self._limit = limit | ||
| self._downcast_ns_timestamp_to_us = Config().get_bool(DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check the format version for downcasting? (We have the table_metadata already, so we have access to it)
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
raulcd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as my previous comment has been fixed
|
would be great to add an integration test showing spark writing V3 with nanos and reading with pyiceberg. We can do that as a follow up |
|
Thanks for the PR @Fokko and thanks @rambleraptor and @raulcd for the review |
Rationale for this change
It looks like we downcast Arrow nanosecond types always to microseconds.
cc @sungwy @kevinjqliu
Are these changes tested?
Are there any user-facing changes?