projjal commented on a change in pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#discussion_r704123433



##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -208,6 +208,22 @@ NUMERIC_FUNCTION(DIVIDE)
 
 #undef DIVIDE
 
+#define POSITIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE positive_##TYPE(gdv_##TYPE in) { return 
static_cast<gdv_##TYPE>(in); }
+
+NUMERIC_FUNCTION(POSITIVE)
+
+#undef POSITIVE
+
+#define NEGATIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE negative_##TYPE(gdv_##TYPE in) { return 
static_cast<gdv_##TYPE>(-1 * in); }

Review comment:
       @jpedroantunes Can you address this? -1 * INT_MIN will cause overflow




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


Reply via email to