andishgar commented on code in PR #46422:
URL: https://github.com/apache/arrow/pull/46422#discussion_r2121035171
##########
cpp/src/arrow/array/statistics.cc:
##########
@@ -15,7 +15,66 @@
// specific language governing permissions and limitations
// under the License.
-// This empty .cc file is for embedding not inlined symbols in
-// arrow::ArrayStatistics into libarrow.
-
#include "arrow/array/statistics.h"
+
+#include <cmath>
+#include <type_traits>
+
+#include "arrow/compare.h"
+#include "arrow/util/logging_internal.h"
+namespace arrow {
+
+namespace {
+
+using ValueType = ArrayStatistics::ValueType;
+
+bool DoubleEquals(const double& left, const double& right, const EqualOptions&
options) {
+ if (left == right) {
+ return options.signed_zeros_equal() || (std::signbit(left) ==
std::signbit(right));
+ } else if (options.nans_equal() && (std::isnan(left) || std::isnan(right))) {
+ return std::isnan(left) && std::isnan(right);
+ } else if (options.use_atol()) {
+ return std::fabs(left - right) <= options.atol();
+ } else {
+ return false;
+ }
+}
Review Comment:
@kou I understand this part of the code, and I think I may have found some
minor issues to report (I'll inform you once I'm completely sure). I have an
initial plan to convert double values to scalars in order to reuse the Arrow
compare facility. However, let me investigate further and get back to you
--
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]