问题
How to use group by clause in Cassandra 3.11 ? I followed this link - Group by in CQL for Cassandra DB not working
although the answer is accepted but when I created the same table and run the query , it is showing different result (not as expected)
the steps I followed are -
create table hashtags(
id uuid,
texts text,
frequence int,
primary key ((texts), frequence, id))
with clustering order by (frequence desc, id asc);
then inserted some dummy data -
after that run following query -
select texts, sum(frequence) from hashtags group by texts;
and the output is -
Expected output -
text | system.sum(frequence)
-------+-----------------------
hello | 10
hi | 7
来源:https://stackoverflow.com/questions/56003345/cassandra-cql-3-11-how-to-use-group-by