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 2022/03/09 22:26:00 UTC

[GitHub] [arrow] anthonylouisbsb commented on a change in pull request #12581: [Gandiva][C++] Add NEGATIVE function for decimal data type

anthonylouisbsb commented on a change in pull request #12581:
URL: https://github.com/apache/arrow/pull/12581#discussion_r823143520



##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -367,6 +368,18 @@ NEGATIVE_INTEGER(int64, 64)
 #undef NEGATIVE
 #undef NEGATIVE_INTEGER
 
+void negative_decimal(gdv_int64 context, int64_t high_bits, uint64_t low_bits,
+                      int32_t /*precision*/, int32_t /*scale*/, int32_t /*out_precision*/,
+                      int32_t /*out_scale*/, int64_t* out_high_bits,
+                      uint64_t* out_low_bits) {
+  arrow::BasicDecimal128 res = arrow::BasicDecimal128(high_bits, low_bits).Negate();
+
+  *out_high_bits = res.high_bits();
+  *out_low_bits = res.low_bits();
+  //  out_precision = precision;
+  //  out_scale = scale;

Review comment:
       Remove these lines




-- 
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