-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid adding a NullBuffer when decoding timestamp offsets (#90)
Since 60288cd we applied an unary_opt kernel to decode timezones. This kernel always returns `Some` unless the date is outside the 1677-2262. Unfortunately, even though the kernel is unlikely to return `None`, applying the kernel always causes the resulting array to get a `NullBuffer`, even if the source array did not have one. In order to avoid unnecessarily adding a `NullBuffer`, this commit first tries to apply a non-nullable kernel; and only falls back to `unary_opt` in the rare case it fails. An alternative implementation that does not risk running the kernel twice would be to check the `NullBuffer`'s `null_count` after running the kernel, then strip it if its `null_count` is zero; but it requires the unnecessary allocation of a `NullBuffer`.
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters