Skip to content

ARROW-9055: [C++] Add sum/mean/minmax kernels for Boolean type - #7478

Closed
kszucs wants to merge 11 commits into
apache:masterfrom
kszucs:ARROW-9055
Closed

ARROW-9055: [C++] Add sum/mean/minmax kernels for Boolean type#7478
kszucs wants to merge 11 commits into
apache:masterfrom
kszucs:ARROW-9055

Conversation

@kszucs

Copy link
Copy Markdown
Member

No description provided.

Comment threadcpp/src/arrow/compute/kernels/aggregate_basic.cc Outdated
@github-actions

Copy link
Copy Markdown

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why isn't it 0 here?

Comment threadcpp/src/arrow/compute/kernels/aggregate_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/aggregate_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/aggregate_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/aggregate_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/aggregate_basic.cc Outdated
@nealrichardson

Copy link
Copy Markdown
Member

I pushed some changes to the R bindings to take advantage of this. I'll note that MinMax also doesn't support boolean and probably should.

@kszucskszucs changed the title ARROW-9055: [C++] Add sum/mean kernels for Boolean typeARROW-9055: [C++] Add sum/mean/minmax kernels for Boolean typeJun 19, 2020

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

BooleanArray has no raw_values() method.

Comment threadcpp/src/arrow/compute/kernels/aggregate_basic.cc Outdated

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

So these were returning the types' extreme values.

Comment threadr/R/compute.R Outdated

@nealrichardsonnealrichardson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From the R side, this LGTM

@kszucs
kszucs requested a review from wesmJune 22, 2020 09:38
@kszucs

Copy link
Copy Markdown
MemberAuthor

ping @wesm

@wesm

wesm commented Jun 24, 2020

Copy link
Copy Markdown
Member

Looking

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The min/max implementation seems more complicated / less efficient than it needs to be, and I think the unit test setup could be simplified, but otherwise this looks OK

Comment threadcpp/src/arrow/compute/kernels/aggregate_basic.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/aggregate_test.cc Outdated
Comment threadcpp/src/arrow/testing/gtest_util.h Outdated
@kszucs

Copy link
Copy Markdown
MemberAuthor

@ursabot build

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1. We will have to resolve the sum([]) -> null/0 by introducing a "minimum valid values" option.

  • minimum # valid values == 0 -> 0
  • minimum # valid values == 1 -> null

@wesmwesm closed this in db719ffJul 1, 2020
@jorisvandenbossche

jorisvandenbossche commented Jul 1, 2020

Copy link
Copy Markdown
Member

We will have to resolve the sum([]) -> null/0 by introducing a "minimum valid values" option.

Do we already have a JIRA to track this?

EDIT -> it is mentioned in ARROW-9054

Sign up for freeto 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.

5 participants

@kszucs@nealrichardson@wesm@jorisvandenbossche@pitrou