Description
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); } } }
A counter-example can easily be given
Assume sum=1, update(std::numeric_limits<int64_t>::max(), 3);
value * repetitions + _stats.getSum() is overflowed, but is still a positive number : 9223372036854775806
Attachments
Issue Links
- causes
-
ORC-1042 Ignore unused-function C++ compile warning on CentOS 7
- Closed
- links to