bkietz commented on code in PR #46866:
URL: https://github.com/apache/arrow/pull/46866#discussion_r2164691585
##########
cpp/src/arrow/util/hashing.h:
##########
@@ -143,6 +144,21 @@ struct ScalarHelper<Scalar, AlgNum,
enable_if_t<std::is_floating_point<Scalar>::
}
};
+template <typename Scalar, uint64_t AlgNum>
+struct ScalarHelper<Scalar, AlgNum,
+ enable_if_t<std::is_same_v<Scalar,
::arrow::util::Float16>>>
+ : public ScalarHelperBase<Scalar, AlgNum> {
+ // ScalarHelper specialization for Float16
+
+ static bool CompareScalars(Scalar u, Scalar v) {
+ if (u.is_nan()) {
+ // XXX should we do a bit-precise comparison?
Review Comment:
I think we should consider any two NaNs equivalent. Bit-precise comparison
can be accomplished by viewing as `uint16_t`
##########
cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc:
##########
@@ -57,8 +61,11 @@ using SignedIntegerTypes = testing::Types<Int8Type,
Int16Type, Int32Type, Int64T
using UnsignedIntegerTypes =
testing::Types<UInt8Type, UInt16Type, UInt32Type, UInt64Type>;
-// TODO(kszucs): add half-float
Review Comment:
👍
--
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]