从Cassandra表

时间:2017-10-05 14:23:54

标签: cassandra cassandra-3.0

我在Cassandra 3.11.0中运行以下查询时遇到此错误:

SELECT JSON * FROM“metrics”。“app_36437104577c4432_calculateMetrics”WHERE application ='app-36437104577c4432'AND user ='admin'AND session ='session15'ALLOW FILTERING;

  

错误[Native-Transport-Requests-1] 2017-10-05 13:47:45,696   QueryMessage.java:129 - 查询期间出现意外错误   java.lang.ArrayIndexOutOfBoundsException:null           at org.codehaus.jackson.io.JsonStringEncoder.quoteAsString(JsonStringEncoder.java:141)   〜[杰克逊核-ASL-1.9.2.jar:1.9.2]           在org.apache.cassandra.cql3.Json.quoteAsJsonString(Json.java:45)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           at org.apache.cassandra.db.marshal.UTF8Type.toJSONString(UTF8Type.java:66)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.selection.Selection.rowToJson(Selection.java:291)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.selection.Selection $ ResultSetBuilder.getOutputRow(Selection.java:431)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.selection.Selection $ ResultSetBuilder.newRow(Selection.java:402)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.processPartition(SelectStatement.java:823)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:759)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:400)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:378)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:251)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:79)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:217)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:248)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:233)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116)   〜[Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.transport.Message $ Dispatcher.channelRead0(Message.java:517)   [Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.transport.Message $ Dispatcher.channelRead0(Message.java:410)   [Apache的卡桑德拉-3.11.0.jar:3.11.0]           在io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)   [网状-全4.0.44.Final.jar:4.0.44.Final]           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)   [网状-全4.0.44.Final.jar:4.0.44.Final]           at io.netty.channel.AbstractChannelHandlerContext.access $ 600(AbstractChannelHandlerContext.java:35)   [网状-全4.0.44.Final.jar:4.0.44.Final]           at io.netty.channel.AbstractChannelHandlerContext $ 7.run(AbstractChannelHandlerContext.java:348)   [网状-全4.0.44.Final.jar:4.0.44.Final]           at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)   [NA:1.8.0_131]           at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService $ FutureTask.run(AbstractLocalAwareExecutorService.java:162)   [Apache的卡桑德拉-3.11.0.jar:3.11.0]           在org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109)   [Apache的卡桑德拉-3.11.0.jar:3.11.0]           at java.lang.Thread.run(Thread.java:748)[na:1.8.0_131] ERROR [Native-Transport-Requests-1] 2017-10-05 13:47:45,697   ErrorMessage.java:384 - 请求期间发生意外异常

CREATE TABLE metrics."app_36437104577c4432_calculateMetrics" (
    application text,
    user text,
    session text,
    time timestamp,
    timeid timeuuid,
    execid timeuuid,
    value text,
    PRIMARY KEY ((application, user, session), time, timeid)
) WITH CLUSTERING ORDER BY (time ASC, timeid ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
   ...;

字段文本的内容是一个长json,如果排除该字段,查询将成功运行。

有什么建议吗? 提前谢谢。

0 个答案:

没有答案