edponce commented on a change in pull request #10349:
URL: https://github.com/apache/arrow/pull/10349#discussion_r704536187
##########
File path: cpp/src/arrow/compute/api_scalar.cc
##########
@@ -175,6 +219,42 @@
ElementWiseAggregateOptions::ElementWiseAggregateOptions(bool skip_nulls)
skip_nulls(skip_nulls) {}
constexpr char ElementWiseAggregateOptions::kTypeName[];
+RoundOptions::RoundOptions(int64_t ndigits, RoundMode round_mode)
+ : FunctionOptions(internal::kRoundOptionsType),
+ ndigits(ndigits),
+ round_mode(round_mode) {
+ static_assert(RoundMode::HALF_DOWN > RoundMode::DOWN &&
+ RoundMode::HALF_DOWN > RoundMode::UP &&
+ RoundMode::HALF_DOWN > RoundMode::TOWARDS_ZERO &&
+ RoundMode::HALF_DOWN > RoundMode::TOWARDS_INFINITY &&
+ RoundMode::HALF_DOWN < RoundMode::HALF_UP &&
+ RoundMode::HALF_DOWN < RoundMode::HALF_TOWARDS_ZERO &&
+ RoundMode::HALF_DOWN < RoundMode::HALF_TOWARDS_INFINITY &&
+ RoundMode::HALF_DOWN < RoundMode::HALF_TO_EVEN &&
+ RoundMode::HALF_DOWN < RoundMode::HALF_TO_ODD,
+ "Invalid order of round modes. Modes prefixed with HALF need
to be "
+ "enumerated last with HALF_DOWN being the first among them.");
+}
+constexpr char RoundOptions::kTypeName[];
+
+MRoundOptions::MRoundOptions(double multiple, RoundMode round_mode)
+ : FunctionOptions(internal::kMRoundOptionsType),
+ multiple(multiple),
+ round_mode(round_mode) {
+ static_assert(RoundMode::HALF_DOWN > RoundMode::DOWN &&
Review comment:
Not really, will leave the assert only in `Round`.
--
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]