mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 01:50:35 +00:00
Currently, we use type type of the column as the accumulator when we average it. This can easily overflow, e.g. (2^31-1)+(3) = overflow. Fix by using __int128 for the accumulator. It's not standard, but it's way more efficient and simpler than the alternatives. Inspired by CASSANDRA-12417, but much simpler due to the availability of __int128. Message-Id: <20171112173529.30764-1-avi@scylladb.com>