我们正在使用聚合查询从表中获取大量数据。 它工作正常,但肯定会在cassandra日志中引发以下错误:-
ERROR [Native-Transport-Requests-3] 2018-10-24 12:27:12,328 Message.java:623 - Unexpected exception during request; channel = [id: 0xedc3f080, L:/172.19.9.2:9042 - R:/172.19.8.69:35436]
java.lang.AssertionError: [] is not superset of [expire_date, start_date, stock]
at org.apache.cassandra.db.partitions.PartitionUpdate.add(PartitionUpdate.java:567) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.DataResolver$RepairMergeListener$MergeListener.onMergedRows(DataResolver.java:280) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.rows.UnfilteredRowIterators$UnfilteredRowMergeIterator$MergeReducer.getReduced(UnfilteredRowIterators.java:556) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.rows.UnfilteredRowIterators$UnfilteredRowMergeIterator$MergeReducer.getReduced(UnfilteredRowIterators.java:518) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:217) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext(MergeIterator.java:156) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.rows.UnfilteredRowIterators$UnfilteredRowMergeIterator.computeNext(UnfilteredRowIterators.java:500) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.rows.UnfilteredRowIterators$UnfilteredRowMergeIterator.computeNext(UnfilteredRowIterators.java:360) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:133) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.FilteredRows.isEmpty(FilteredRows.java:50) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.Filter.closeIfEmpty(Filter.java:73) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.Filter.applyToPartition(Filter.java:43) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.Filter.applyToPartition(Filter.java:26) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:96) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy$SingleRangeResponse.computeNext(StorageProxy.java:2090) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy$SingleRangeResponse.computeNext(StorageProxy.java:2062) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:92) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy$RangeCommandIterator.computeNext(StorageProxy.java:2135) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.StorageProxy$RangeCommandIterator.computeNext(StorageProxy.java:2100) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:92) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.pager.AggregationQueryPager$GroupByPartitionIterator.fetchNextRowIterator(AggregationQueryPager.java:226) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.pager.AggregationQueryPager$GroupByPartitionIterator.hasNext(AggregationQueryPager.java:210) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.service.pager.AggregationQueryPager$GroupByPartitionIterator$GroupByRowIterator.hasNext(AggregationQueryPager.java:370) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.processPartition(SelectStatement.java:820) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:759) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:400) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:378) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:251) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:79) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:217) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:248) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:233) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116) ~[apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:517) [apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:410) [apache-cassandra-3.10.jar:3.10]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.39.Final.jar:4.0.39.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [netty-all-4.0.39.Final.jar:4.0.39.Final]
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35) [netty-all-4.0.39.Final.jar:4.0.39.Final]
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:357) [netty-all-4.0.39.Final.jar:4.0.39.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_91]
at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) [apache-cassandra-3.10.jar:3.10]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [apache-cassandra-3.10.jar:3.10]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
无法完全确定错误。
表结构
CREATE TABLE brodosmarketplace.article_supplier_info (
ean text,
condition text,
sub_condition text,
supplier_id bigint,
expire_date bigint,
price double,
start_date bigint,
stock bigint,
PRIMARY KEY (ean, condition, sub_condition, supplier_id)
) WITH CLUSTERING ORDER BY (condition ASC, sub_condition ASC, supplier_id ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
使用的cql查询:
SELECT ean, condition, sum(stock) as stock FROM article_supplier_info WHERE start_date <= currentDate AND expire_date > currentDate AND stock > 0 GROUP BY ean, condition ALLOW FILTERING
答案 0 :(得分:0)
这不是答案,而只是一个建议。
不是专家,但是通过查看code似乎在以下代码块中失败了:
public void add(Row row) { if (row.isEmpty()) return; if (row.isStatic()) { // this assert is expensive, and possibly of limited value; we should consider removing it // or introducing a new class of assertions for test purposes assert columns().statics.containsAll(row.columns()) : columns().statics + " is not superset of " + row.columns(); staticRow = staticRow.isEmpty() ? row : Rows.merge(staticRow, row); } else { // this assert is expensive, and possibly of limited value; we should consider removing it // or introducing a new class of assertions for test purposes assert columns().regulars.containsAll(row.columns()) : columns().regulars + " is not superset of " + row.columns(); rowBuilder.add(row); } }
我希望这可以帮助您在代码中查找问题。