Skip to content
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

Handle null Timestamp values #175

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Handle null Timestamp values #175

merged 2 commits into from
Nov 29, 2022

Conversation

jonmmease
Copy link
Collaborator

Small change to handle null Timestamp values.

Issue: The arrow unary function can be used to map a unary function across a primitive array, propagating the nulls mask. The docs for unary state that the function must be infallible because it will be evaluated with whatever happens to be stored in the data array for null values. The issue is that timestamp_to_timestamptz UDF performs a timezone conversion, and so it is not valid for arbitrary i32 array elements.

Solution: Switch to using array.iter().map() to map over boxed Optional array element values. This way we only perform the timezone conversions on valid timestamp values.

@jonmmease jonmmease merged commit ed3a760 into main Nov 29, 2022
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.

1 participant