You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/16 12:34:31 UTC
[GitHub] [arrow] pitrou commented on a change in pull request #10928: ARROW-13614: [C++] Add decimal support to min_max/hash_min_max
pitrou commented on a change in pull request #10928:
URL: https://github.com/apache/arrow/pull/10928#discussion_r689496300
##########
File path: cpp/src/arrow/util/basic_decimal.h
##########
@@ -388,6 +399,31 @@ class ARROW_EXPORT BasicDecimal256 {
/// \brief In-place division.
BasicDecimal256& operator/=(const BasicDecimal256& right);
+ /// \brief Get the maximum decimal value (is not a valid value).
+ static inline constexpr BasicDecimal256 GetMaxSentinel() {
+#if ARROW_LITTLE_ENDIAN
+ return BasicDecimal256({std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max(),
+ static_cast<uint64_t>(std::numeric_limits<int64_t>::max())});
+#else
+ return BasicDecimal256({static_cast<uint64_t>(std::numeric_limits<int64_t>::max()),
+ std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max()});
+#endif
Review comment:
The former looks more desirable to me, as it can be computed at compile time.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org