Repository: orc
Updated Branches:
  refs/heads/master f5218751e -> 6453f160a


ORC-338. Workaround C++ compiler bug in xcode 9.3 by removing an inline
function.

Fixes #227

Signed-off-by: Owen O'Malley <omal...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/orc/repo
Commit: http://git-wip-us.apache.org/repos/asf/orc/commit/6453f160
Tree: http://git-wip-us.apache.org/repos/asf/orc/tree/6453f160
Diff: http://git-wip-us.apache.org/repos/asf/orc/diff/6453f160

Branch: refs/heads/master
Commit: 6453f160a05f96897410629b67374b39f16ca5c2
Parents: f521875
Author: Owen O'Malley <omal...@apache.org>
Authored: Thu Apr 12 07:43:02 2018 -0700
Committer: Owen O'Malley <omal...@apache.org>
Committed: Thu Apr 12 07:47:05 2018 -0700

----------------------------------------------------------------------
 c++/src/Statistics.cc            | 12 ++++++++++++
 c++/src/Statistics.hh            | 12 +-----------
 c++/test/TestColumnStatistics.cc |  1 +
 3 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/orc/blob/6453f160/c++/src/Statistics.cc
----------------------------------------------------------------------
diff --git a/c++/src/Statistics.cc b/c++/src/Statistics.cc
index b750511..a72560e 100644
--- a/c++/src/Statistics.cc
+++ b/c++/src/Statistics.cc
@@ -167,6 +167,18 @@ namespace orc {
     // PASS
   }
 
+  void IntegerColumnStatisticsImpl::update(int64_t value, int repetitions) {
+    _stats.updateMinMax(value);
+
+    if (_stats.hasSum()) {
+      bool wasPositive = _stats.getSum() >= 0;
+      _stats.setSum(value * repetitions + _stats.getSum());
+      if ((value >= 0) == wasPositive) {
+        _stats.setHasSum((_stats.getSum() >= 0) == wasPositive);
+      }
+    }
+  }
+
   StringColumnStatisticsImpl::~StringColumnStatisticsImpl() {
     // PASS
   }

http://git-wip-us.apache.org/repos/asf/orc/blob/6453f160/c++/src/Statistics.hh
----------------------------------------------------------------------
diff --git a/c++/src/Statistics.hh b/c++/src/Statistics.hh
index a1f1c35..8122758 100644
--- a/c++/src/Statistics.hh
+++ b/c++/src/Statistics.hh
@@ -948,17 +948,7 @@ namespace orc {
       _stats.setSum(sum);
     }
 
-    void update(int64_t value, int repetitions) {
-      _stats.updateMinMax(value);
-
-      if (_stats.hasSum()) {
-        bool wasPositive = _stats.getSum() >= 0;
-        _stats.setSum(value * repetitions + _stats.getSum());
-        if ((value >= 0) == wasPositive) {
-          _stats.setHasSum((_stats.getSum() >= 0) == wasPositive);
-        }
-      }
-    }
+    void update(int64_t value, int repetitions);
 
     void merge(const MutableColumnStatistics& other) override {
       const IntegerColumnStatisticsImpl& intStats =

http://git-wip-us.apache.org/repos/asf/orc/blob/6453f160/c++/test/TestColumnStatistics.cc
----------------------------------------------------------------------
diff --git a/c++/test/TestColumnStatistics.cc b/c++/test/TestColumnStatistics.cc
index 24ad394..315ac47 100644
--- a/c++/test/TestColumnStatistics.cc
+++ b/c++/test/TestColumnStatistics.cc
@@ -82,6 +82,7 @@ namespace orc {
     EXPECT_TRUE(other->hasNull());
     EXPECT_EQ(9999, other->getMaximum());
     EXPECT_EQ(-9999, other->getMinimum());
+    EXPECT_TRUE(other->hasSum());
     EXPECT_EQ(100000, other->getSum());
 
     intStats->merge(*other);

Reply via email to