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

ARROW-11439: [Rust] Add year support to temporal kernels #9374

Closed
wants to merge 5 commits into from

Conversation

Dandandan
Copy link
Contributor

@Dandandan Dandandan commented Jan 30, 2021

This adds year support to the temporal module. Year support is something needed for some TCPH queries.
Together with extract support
#9359

we should be able to add EXTRACT (YEAR FROM dt) support to DataFusion.

Other changes in the PR:

  • Adding some more tests to hour
  • Removing datatype check from inner loop (there is still one more check in value_as_datetime and value_as_time) but I leave that for a future PR, as well as further performance improvements (e.g. avoiding the Int32Builder, avoiding null checks, adding some microbenchmarks etc.).
  • Returning an error message on unsupported datatypes (instead of returning an array with nulls). This is backwards incompatible, but I think this is reasonable.

@github-actions
Copy link

Copy link
Contributor

@nevi-me nevi-me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, there's a clippy lint and a minor nit.

rust/arrow/src/compute/kernels/temporal.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me - thanks @Dandandan

@alamb alamb closed this in 68777f9 Feb 3, 2021
nevi-me pushed a commit to nevi-me/arrow that referenced this pull request Feb 13, 2021
This adds year support to the temporal module. Year support is something needed for some TCPH queries.
Together with `extract` support
apache#9359

we should be able to add `EXTRACT (YEAR FROM dt)` support to DataFusion.

Other changes in the PR:
* Adding some more tests to `hour`
* Removing datatype check from inner loop (there is still one more check in `value_as_datetime` and `value_as_time`) but I leave that for a future PR, as well as further performance improvements (e.g. avoiding the `Int32Builder`, avoiding null checks, adding some microbenchmarks etc.).
* Returning an error message on unsupported datatypes (instead of returning an array with nulls). This is backwards incompatible, but I think this is reasonable.

Closes apache#9374 from Dandandan/year

Authored-by: Heres, Daniel <danielheres@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
This adds year support to the temporal module. Year support is something needed for some TCPH queries.
Together with `extract` support
apache#9359

we should be able to add `EXTRACT (YEAR FROM dt)` support to DataFusion.

Other changes in the PR:
* Adding some more tests to `hour`
* Removing datatype check from inner loop (there is still one more check in `value_as_datetime` and `value_as_time`) but I leave that for a future PR, as well as further performance improvements (e.g. avoiding the `Int32Builder`, avoiding null checks, adding some microbenchmarks etc.).
* Returning an error message on unsupported datatypes (instead of returning an array with nulls). This is backwards incompatible, but I think this is reasonable.

Closes apache#9374 from Dandandan/year

Authored-by: Heres, Daniel <danielheres@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
michalursa pushed a commit to michalursa/arrow that referenced this pull request Jun 13, 2021
This adds year support to the temporal module. Year support is something needed for some TCPH queries.
Together with `extract` support
apache#9359

we should be able to add `EXTRACT (YEAR FROM dt)` support to DataFusion.

Other changes in the PR:
* Adding some more tests to `hour`
* Removing datatype check from inner loop (there is still one more check in `value_as_datetime` and `value_as_time`) but I leave that for a future PR, as well as further performance improvements (e.g. avoiding the `Int32Builder`, avoiding null checks, adding some microbenchmarks etc.).
* Returning an error message on unsupported datatypes (instead of returning an array with nulls). This is backwards incompatible, but I think this is reasonable.

Closes apache#9374 from Dandandan/year

Authored-by: Heres, Daniel <danielheres@gmail.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants