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-10944: [Rust] Implement min/max aggregate kernels for BooleanArray #8946

Closed
wants to merge 5 commits into from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 16, 2020

Rationale: While Min/Max is a somewhat silly / meaningless operation, typically database systems support it for completeness.

This PR adds a basic implementation and tests.

More detail on usecase is here

@codecov-io
Copy link

codecov-io commented Dec 16, 2020

Codecov Report

Merging #8946 (d24c6f1) into master (3e89a9c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8946      +/-   ##
==========================================
+ Coverage   83.17%   83.18%   +0.01%     
==========================================
  Files         197      197              
  Lines       48526    48573      +47     
==========================================
+ Hits        40360    40407      +47     
  Misses       8166     8166              
Impacted Files Coverage Δ
rust/arrow/src/compute/kernels/aggregate.rs 75.00% <100.00%> (+3.57%) ⬆️

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 3e89a9c...d24c6f1. Read the comment docs.

@github-actions
Copy link

Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

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

LGTM

@Dandandan
Copy link
Contributor

Dandandan commented Dec 17, 2020

On closer inspection, is it actually correct now? What would the output of max(null, false) be in the current implementation?

@Dandandan
Copy link
Contributor

I think correct would be

array.iter().find(|&b| b == Some(false)).flatten().or(Some(true)) and the other way around?

@alamb
Copy link
Contributor Author

alamb commented Dec 17, 2020

What would the output of max(null, false) be in the current implementation?

A: Incorrect (the code in 075277c produces None when the answer should be false).

I think correct would be
👍

I implemented this suggestion, as well as additional tests in b5a14d9. Thank you @Dandandan

@jorgecarleitao
Copy link
Member

This PR introduces only private methods and are never used internally. Isn't this an issue?

@nevi-me
Copy link
Contributor

nevi-me commented Dec 18, 2020

This PR introduces only private methods and are never used internally. Isn't this an issue?

Great catch! They should be public

@alamb
Copy link
Contributor Author

alamb commented Dec 18, 2020

🤦 yes that is an excellent catch @jorgecarleitao -- I plan to polish this up tomorrow. I apologize for all the noise. Thank you all for the through reviews @nevi-me and @Dandandan

@alamb alamb force-pushed the ARROW-10944-min-max-boolean branch from 79c9d8b to d24c6f1 Compare December 19, 2020 21:04
Copy link
Member

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

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

:shipit:

@alamb alamb closed this in 962d0bb Dec 20, 2020
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
Rationale: While Min/Max is a somewhat silly / meaningless operation,  typically database systems support it for completeness.

This PR adds a basic implementation and tests.

More detail on usecase is [here](https://github.com/influxdata/influxdb_iox/issues/568)

Closes apache#8946 from alamb/ARROW-10944-min-max-boolean

Authored-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

None yet

5 participants