Skip to content

Commit 3451a5c

Browse files
committed
Push fix for imprecisions on macOS
1 parent 7e085da commit 3451a5c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cpp/src/arrow/compute/kernels/aggregate_test.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,6 +4152,14 @@ class TestRandomQuantileKernel : public TestPrimitiveQuantileKernel<ArrowType> {
41524152

41534153
void VerifyTDigest(const std::shared_ptr<ChunkedArray>& chunked,
41544154
std::vector<double>& quantiles) {
4155+
// For some reasons computations on macOS seem much more approximate.
4156+
// A possible explanation is that libc++ has less precise implementations
4157+
// of std::sin and std::asin, used in the TDigest implementation.
4158+
#ifdef __APPLE__
4159+
constexpr double kRelativeTolerance = 0.09;
4160+
#else
4161+
constexpr double kRelativeTolerance = 0.05;
4162+
#endif
41554163
TDigestOptions options(quantiles);
41564164
ASSERT_OK_AND_ASSIGN(Datum out, TDigest(chunked, options));
41574165
const auto& out_array = out.make_array();

0 commit comments

Comments
 (0)