projjal commented on a change in pull request #9785:
URL: https://github.com/apache/arrow/pull/9785#discussion_r604883353
##########
File path: cpp/src/gandiva/decimal_scalar.h
##########
@@ -55,3 +55,19 @@ class DecimalScalar128 : public BasicDecimalScalar128 {
};
} // namespace gandiva
+
+namespace std {
+template <>
+struct hash<gandiva::DecimalScalar128> {
+ std::size_t operator()(gandiva::DecimalScalar128 const& s) const noexcept {
+ arrow::BasicDecimal128 dvalue(s.value());
+ std::size_t h0 = std::hash<int64_t>{}(dvalue.high_bits());
+ std::size_t h1 = std::hash<uint64_t>{}(dvalue.low_bits());
+
+ std::size_t h2 = std::hash<int32_t>{}(s.precision());
+ std::size_t h3 = std::hash<int32_t>{}(s.scale());
+
+ return (((h0 ^ (h1 << 1) >> 1) ^ (h2 << 1) >> 1) ^ h3 << 1);
Review comment:
No. Take a look at
https://github.com/apache/arrow/blob/master/cpp/src/gandiva/filter.cc#L48
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]