Skip to content

Conversation

@andishgar
Copy link
Contributor

@andishgar andishgar commented May 13, 2025

Rationale for this change

arrow::ArrayStatistics::Equals does not handle double values for ArrayStatistics::ValueType correctly

What changes are included in this PR?

Add arrow::EqualOptions to arrow::ArrayStatistics::Eqauls()
Add arrow::ArrayStatisticsEqauls()
Add EqualOptions::use_atol_
Add EqualOptions::use_atol()
Add EqualOptions::use_atol(bool v)

Are these changes tested?

Yes, I ran the relevant unit tests.

Are there any user-facing changes?

Yes.
Add arrow::ArrayStatisticsEqauls()
Add EqualOptions::use_atol()
Add EqualOptions::use_atol(bool v)

@andishgar andishgar marked this pull request as draft May 13, 2025 09:25
@andishgar andishgar marked this pull request as ready for review May 13, 2025 12:44
@andishgar
Copy link
Contributor Author

@kou what is your view on arrow::ArrayStatistics::ApproximateEquals? If we aim for consistency with the Arrow C++ implementation, it seems this method should be part of it.

@kou kou changed the title GH-46395: [C++][Statistics]: Correct the Equal method for min and max in arrow::ArrayStatistics GH-46395: [C++][Statistics] Correct the Equal method for min and max in arrow::ArrayStatistics May 13, 2025
@kou
Copy link
Member

kou commented May 14, 2025

It may be better that we add is_approximate to EqualOptions than adding ApproximateEquals.

Could you start a discussion for this like #46396 ?

@andishgar
Copy link
Contributor Author

I will open an issue for discussion soon

@andishgar andishgar force-pushed the correct-statistics-equal-method branch from afb535b to 663b645 Compare May 30, 2025 12:16
@andishgar andishgar marked this pull request as draft May 30, 2025 12:48
@andishgar andishgar marked this pull request as ready for review May 30, 2025 13:34
@andishgar andishgar marked this pull request as draft May 30, 2025 13:57
@andishgar andishgar marked this pull request as ready for review May 30, 2025 18:04
@andishgar
Copy link
Contributor Author

@kou
I remove ApproximateEqauls and the Pull Request is ready for review

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels May 31, 2025
@andishgar
Copy link
Contributor Author

Thank you for your feedback, @kou — I'll look into it

@andishgar andishgar force-pushed the correct-statistics-equal-method branch from 3dbecf1 to a362b94 Compare June 1, 2025 11:34
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jun 1, 2025
@andishgar andishgar force-pushed the correct-statistics-equal-method branch from a362b94 to 1d6812d Compare June 1, 2025 11:47
@andishgar andishgar marked this pull request as draft June 1, 2025 11:49
@andishgar andishgar marked this pull request as ready for review June 1, 2025 13:57
@andishgar andishgar requested a review from kou June 1, 2025 13:58
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jun 2, 2025
@andishgar
Copy link
Contributor Author

Thank you for your feedback, @kou — I'll look into it

@github-actions github-actions bot added the awaiting changes Awaiting changes label Jun 4, 2025
@andishgar
Copy link
Contributor Author

@kou I apologize for my last commit — it seems I forgot to apply some of the notes you mentioned.

@andishgar andishgar force-pushed the correct-statistics-equal-method branch from 3ff6117 to d661877 Compare June 6, 2025 13:54
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jun 6, 2025
andishgar added 11 commits June 7, 2025 01:47
replace allow_atol to use_atol with relevant changes
move type alias declaration for ValueType into anonymous namesapce
comment == and != for operator and remove default options
clear comments test and comment regarding different ValueType
breakdown TestEqualityDoubleValues test case into several test cases
@andishgar andishgar force-pushed the correct-statistics-equal-method branch from d661877 to e06599f Compare June 6, 2025 22:18
@andishgar andishgar requested a review from kou June 7, 2025 06:41
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou changed the title GH-46395: [C++][Statistics] Correct the Equal method for min and max in arrow::ArrayStatistics GH-46395: [C++][Statistics] Use EqualOptions for min and max in arrow::ArrayStatistics::Equals() Jun 7, 2025
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Jun 7, 2025
@kou kou merged commit 0e5249b into apache:main Jun 7, 2025
38 of 40 checks passed
@kou kou removed the awaiting merge Awaiting merge label Jun 7, 2025
@andishgar andishgar deleted the correct-statistics-equal-method branch June 7, 2025 23:04
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 0e5249b.

There were 72 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

alinaliBQ pushed a commit to Bit-Quill/arrow that referenced this pull request Jun 17, 2025
… arrow::ArrayStatistics::Equals() (apache#46422)

### Rationale for this change
`arrow::ArrayStatistics::Equals` does not handle double values for `ArrayStatistics::ValueType` correctly

### What changes are included in this PR?
Add `arrow::EqualOptions` to `arrow::ArrayStatistics::Eqauls()`
Add `arrow::ArrayStatisticsEqauls()`
Add `EqualOptions::use_atol_`
Add `EqualOptions::use_atol()`
Add `EqualOptions::use_atol(bool v)`
### Are these changes tested?
Yes, I ran the relevant unit tests.
### Are there any user-facing changes?
Yes.
Add `arrow::ArrayStatisticsEqauls()`
Add `EqualOptions::use_atol()`
Add `EqualOptions::use_atol(bool v)`

* GitHub Issue: apache#46395

Authored-by: Arash Andishgar <arashandishgar1@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
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.

2 participants