andishgar commented on code in PR #55744:
URL: https://github.com/apache/arrow/pull/55744#discussion_r4680790839
##########
cpp/src/arrow/compute/kernels/aggregate_test.cc:
##########
@@ -3849,10 +3849,9 @@ class TestPrimitiveQuantileKernel : public
::testing::Test {
for (int64_t j = 0; j < out_array->length(); ++j) {
const auto& numeric_scalar =
checked_pointer_cast<DoubleScalar>(expected[j][i].scalar());
- ASSERT_TRUE((quantiles[j] == numeric_scalar->value) ||
- (std::isnan(quantiles[j]) &&
std::isnan(numeric_scalar->value)))
- << " Actual Value: " << quantiles[j] << "\n"
- << "Expected Value: " << numeric_scalar->value;
+ // The results may not be rigorously equal to the "naive" results
+ // on some architecture and/or with some compiler flags (GH-12681).
+ AssertWithinUlp(quantiles[j], numeric_scalar->value, 1);
Review Comment:
@pitrou, I forgot to mention one more thing: using ULP-based comparison is
inappropriate for `LOWER`, `HIGHER`, and `NEAREST`, since the selected values
are supposed to remain unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]