mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-28 18:50:53 +00:00
Aggregate functions on counters do not exist. Until now counters could, at best, fall back to blob->blob overloads, e.g.: ``` cqlsh> select max(cnt) from ks.tbl; system.max(cnt) ---------------------- 0x000000000000000a (1 rows) cqlsh> select sum(entities) from ks.tbl; InvalidRequest: Error from server: code=2200 [Invalid query] message="Invalid call to function sum, none of its type signatures match [...] ``` Meanwhile, counters are compatible with bigints (aka. `long_type'), so bigint overloads can be used on them (e.g. sum(bigint)->bigint). This is achieved here by a special rule in overload resolution, which makes `selector' perceive counters as an `EXACT_MATCH' to counter's underlying type (`long_type', aka. bigint).