You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/09/28 03:37:04 UTC

[GitHub] [orc] guiyanakuang commented on a change in pull request #917: ORC-1008: Fix overflow detection code for C++ int64_t / java long

guiyanakuang commented on a change in pull request #917:
URL: https://github.com/apache/orc/pull/917#discussion_r717197131



##########
File path: c++/src/Statistics.hh
##########
@@ -964,7 +964,23 @@ namespace orc {
       _stats.setSum(sum);
     }
 
-    void update(int64_t value, int repetitions);
+    void update(int64_t value, int repetitions) {
+      _stats.updateMinMax(value);
+
+      if (_stats.hasSum()) {
+        if (repetitions > 1) {
+          _stats.setHasSum(__builtin_mul_overflow(value, repetitions, &value) == 0);

Review comment:
       @wgtmac Sorry, I'm still a C++ novice. Let me see how compatible




-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org