Server-side warning: Aggregation query used without partition key

While using the C/C++ driver of Cassandra, I at times see these kind of messages popping up in my console:

1460937092.140 [WARN] (src/response.cpp:51:char*
      cass::Response::decode_warnings(char*, size_t)):
      Server-side warning: Aggregation query used without partition key

Wondering whether someone knows what that means. What should I be looking for in my code that could generate this error, or is it just something on the server side that I have no control over?


That warning is telling you that you are doing a select using a user defined aggregate without a partition key. That may be one that is built in like avg, count, min, max or could've one of your own.

An example:

select avg(temperature) from weather_data;


select avg(temperature) from weather_data where id = 1;

The first example would scan all rows of data in the cluster and could be a serious performance hit. If there are enough rows, the query could time out.

The second will only scan a single partition of data which keeps the query to one server and is the recommended usage.

Need Your Help

Method to dynamically load java class files

java class reflection dynamic load

What would be a good way to dynamically load java class files so that a program compiled into a jar can read all the class files in a directory and use them, and how can one write the files so that...

AssertEquals 2 Lists ignore order

java arrays unit-testing junit assertion

That should be really simple question I believe. But somehow I can't find answer in Google.