mirror of https://github.com/apache/cassandra
Log warning message on aggregation queries without key or on multiple keys
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-18219
This commit is contained in:
parent
b74c86404a
commit
b8494a8275
|
|
@ -1,4 +1,5 @@
|
|||
4.0.8
|
||||
* Log warning message on aggregation queries without key or on multiple keys (CASSANDRA-18219)
|
||||
* Fix the output of FQL dump tool to properly separate entries (CASSANDRA-18215)
|
||||
* Add cache type information for maximum memory usage warning message (CASSANDRA-18184)
|
||||
* Fix NPE in fqltool dump on null value (CASSANDRA-18113)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.cassandra.cql3.statements;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.MoreObjects;
|
||||
|
|
@ -67,6 +68,7 @@ import org.apache.cassandra.service.pager.QueryPager;
|
|||
import org.apache.cassandra.transport.ProtocolVersion;
|
||||
import org.apache.cassandra.transport.messages.ResultMessage;
|
||||
import org.apache.cassandra.utils.ByteBufferUtil;
|
||||
import org.apache.cassandra.utils.NoSpamLogger;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -88,6 +90,7 @@ import static org.apache.cassandra.utils.ByteBufferUtil.UNSET_BYTE_BUFFER;
|
|||
public class SelectStatement implements CQLStatement.SingleKeyspaceCqlStatement
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(SelectStatement.class);
|
||||
private static final NoSpamLogger noSpamLogger = NoSpamLogger.getLogger(SelectStatement.logger, 1, TimeUnit.MINUTES);
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 10000;
|
||||
|
||||
|
|
@ -383,10 +386,14 @@ public class SelectStatement implements CQLStatement.SingleKeyspaceCqlStatement
|
|||
if (!restrictions.hasPartitionKeyRestrictions())
|
||||
{
|
||||
warn("Aggregation query used without partition key");
|
||||
noSpamLogger.warn(String.format("Aggregation query used without partition key on table %s.%s, aggregation type: %s",
|
||||
keyspace(), columnFamily(), aggregationSpec.kind()));
|
||||
}
|
||||
else if (restrictions.keyIsInRelation())
|
||||
{
|
||||
warn("Aggregation query used on multiple partition keys (IN restriction)");
|
||||
noSpamLogger.warn(String.format("Aggregation query used on multiple partition keys (IN restriction) on table %s.%s, aggregation type: %s",
|
||||
keyspace(), columnFamily(), aggregationSpec.kind()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue