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

implement second/minute helpers for temporal #493

Merged
merged 3 commits into from
Jun 23, 2021

Conversation

ovr
Copy link
Contributor

@ovr ovr commented Jun 23, 2021

Hello!

Which issue does this PR close?

I am interested in the implementation of:

EXTRACT (SECOND FROM '')
EXTRACT (MINUTE FROM '')

in the DF.

Thanks

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 23, 2021
ovr and others added 2 commits June 23, 2021 11:16
Co-authored-by: Daniël Heres <danielheres@gmail.com>
Co-authored-by: Daniël Heres <danielheres@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #493 (c297f3f) into master (4c7d418) will decrease coverage by 0.03%.
The diff coverage is 88.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
- Coverage   82.65%   82.61%   -0.04%     
==========================================
  Files         165      165              
  Lines       45524    45652     +128     
==========================================
+ Hits        37628    37717      +89     
- Misses       7896     7935      +39     
Impacted Files Coverage Δ
arrow/src/compute/kernels/temporal.rs 88.97% <88.00%> (-0.64%) ⬇️
arrow/src/array/transform/boolean.rs 76.92% <0.00%> (-7.70%) ⬇️
arrow/src/ffi.rs 78.71% <0.00%> (-4.15%) ⬇️
arrow/src/array/equal/mod.rs 93.93% <0.00%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c7d418...c297f3f. Read the comment docs.

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.

Thank you @ovr - this looks great.

@alamb alamb merged commit 9723209 into apache:master Jun 23, 2021
@alamb
Copy link
Contributor

alamb commented Jun 23, 2021

BTW I plan to cherry pick this into the 4.4 release of arrow-rs, which I hope will be released this weekend or early next week (and then automatically be available to datafusion too)

alamb pushed a commit that referenced this pull request Jun 23, 2021
* implement second/minute helpers for temporal

* Update arrow/src/compute/kernels/temporal.rs

Co-authored-by: Daniël Heres <danielheres@gmail.com>

* Update arrow/src/compute/kernels/temporal.rs

Co-authored-by: Daniël Heres <danielheres@gmail.com>

Co-authored-by: Daniël Heres <danielheres@gmail.com>
{
let mut b = Int32Builder::new(array.len());
match array.data_type() {
&DataType::Date64 | &DataType::Timestamp(_, _) => {
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure this is correct: when the timestamp is timezone-aware can we extract the second from its corresponding timezone-unaware equivalent?

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 In general I think Rust/Arrow and DataFusion's support for timezone aware timestamps is pretty poor. I wonder if we could perhaps change this to DataType::Timestamp(_, None) and error if DataType::Timestamp(_, Some(tz))

Copy link
Contributor

Choose a reason for hiding this comment

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

Filed #500 to track

alamb added a commit that referenced this pull request Jun 24, 2021
* implement second/minute helpers for temporal

* Update arrow/src/compute/kernels/temporal.rs

Co-authored-by: Daniël Heres <danielheres@gmail.com>

* Update arrow/src/compute/kernels/temporal.rs

Co-authored-by: Daniël Heres <danielheres@gmail.com>

Co-authored-by: Daniël Heres <danielheres@gmail.com>

Co-authored-by: Dmitry Patsura <zaets28rus@gmail.com>
Co-authored-by: Daniël Heres <danielheres@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants