Skip to content

ARROW-11043: [C++] Add "is_nan" kernel - #9023

Closed
bu2 wants to merge 5 commits into
apache:masterfrom
bu2:ARROW-11043
Closed

ARROW-11043: [C++] Add "is_nan" kernel#9023
bu2 wants to merge 5 commits into
apache:masterfrom
bu2:ARROW-11043

Conversation

@bu2

@bu2bu2 commented Dec 28, 2020

Copy link
Copy Markdown
Contributor

Add a "is_nan" kernel to check for NaN "equality" for FloatArray and DoubleArray (based on std::isnan()). The kernel signature is based on "is_null" kernel so I put my code in arrow/compute/kernels/scalar_validity.cc... but the implementation take some inspiration from "compare" kernel.

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

Copy link
Copy Markdown

Comment threadcpp/src/arrow/compute/kernels/scalar_validity_test.cc Outdated
Comment threadcpp/src/arrow/compute/api_scalar.h Outdated
Comment threaddocs/source/cpp/compute.rst Outdated

@pitroupitrou 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.

Thank you for the PR @bu2 ! This looks basically ok, here are a number of small comments.

Comment threadcpp/src/arrow/compute/api_scalar.h Outdated
Comment threadcpp/src/arrow/compute/kernels/common.h Outdated
Comment threadcpp/src/arrow/compute/kernels/scalar_validity.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/scalar_validity_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/scalar_validity_test.cc Outdated
Comment threadcpp/src/arrow/compute/kernels/scalar_validity_test.cc Outdated
Comment threaddocs/source/cpp/compute.rst Outdated
bu2 added 5 commits January 5, 2021 17:43
Fix following reviewer's comment:
* iff not a typo,
* test for nulls,
* update docs/source/cpp/compute.rst
Then:
* apply clang-format to pass CI lint check.
Fix following reviewer's comment:
* update docs/source/cpp/compute.rst
Fix following reviewer's comment:
* Update "since version number"
* Improve kernel documentation (remove "according to std::isnan()")
* Improve code style (replace typedef aliases by using aliases)
* Minor fix (float32 literal without f suffix)
Fix following reviewer's comment:
* Move <cmath> include from common.h to kernel source.
@bu2

bu2 commented Jan 5, 2021

Copy link
Copy Markdown
ContributorAuthor

PR rebased!

@pitroupitrou 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, thank you

@pitroupitrou closed this in dab1eebJan 5, 2021
@jorisvandenbossche

Copy link
Copy Markdown
Member

Thanks a lot @bu2 !

@bu2

bu2 commented Jan 5, 2021

Copy link
Copy Markdown
ContributorAuthor

Thanks to @cyb70289 for the initial review.

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

4 participants

@bu2@jorisvandenbossche@pitrou@cyb70289