Repository: orc Updated Branches: refs/heads/master 6453f160a -> ac5504d9f (forced update)
ORC-338. Workaround C++ compiler bug in xcode 9.3 by removing an inline function. Fixes #246 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/ac5504d9 Tree: http://git-wip-us.apache.org/repos/asf/orc/tree/ac5504d9 Diff: http://git-wip-us.apache.org/repos/asf/orc/diff/ac5504d9 Branch: refs/heads/master Commit: ac5504d9fc5f64fb5ff2b9bcdf5aea4a4d8c5b11 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 08:11: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/ac5504d9/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/ac5504d9/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/ac5504d9/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);