InvalidQueryException的原因是什么:未知标识符?

时间:2016-09-02 09:28:43

标签: java exception cassandra apache-camel endpoint

我在Cassandra中有一个用一些列定义的表。 我有Cassandra 2.2.0和Camel 2.17.1。

cassandra@cqlsh> DESCRIBE TABLE logkeyspace.mytable

CREATE TABLE logkeyspace.mytable (
    id text,
    timestamp timestamp,
    col03 text,
    col04 text,
    col05 text,
    col06 text,
    col07 text,
    col08 text,
    col09 text,
    col10 text,
    col11 text,
    PRIMARY KEY (id, timestamp)
) WITH CLUSTERING ORDER BY (timestamp ASC)
    AND bloom_filter_fp_chance = 0.01
    ...
    AND speculative_retry = '99.0PERCENTILE';
CREATE INDEX mytable_idx_07 ON logkeyspace.mytable (col07);
CREATE INDEX mytable_idx_09 ON logkeyspace.mytable (col09);

命令(列的其他顺序):

cassandra@cqlsh> INSERT INTO logkeyspace.mytable(id,timestamp,col11,col08,col06,col03,col07,col09,col04,col10,col05) VALUES ('1',dateof(now()),'TNT','SOL','FB','CS','RT','ST','H','s','p');

运作良好。

但是从camel cassandra结束点触发的同一个查询以异常结束:

java.util.concurrent.ExecutionException:com.datastax.driver.core.exceptions.InvalidQueryException:未知标识符col09

只知道col09。

稍后通过使用ALTER TABLE logkeyspace.mytable ADD col09添加此列; CQL命令。

我还检查过,当我只删除col09时,一切正常,所以这不是问题,例如与参数列表的长度。

在哪里搜索问题,这可能是导致问题的根本原因?

stacktrace的重要部分是:

Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier col09
        at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50) 
        at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) 
        at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:79) 
        at org.apache.camel.component.cassandra.CassandraEndpoint.prepareStatement(CassandraEndpoint.java:169) 
        at org.apache.camel.component.cassandra.CassandraEndpoint.prepareStatement(CassandraEndpoint.java:180) 
        at org.apache.camel.component.cassandra.CassandraProducer.doStart(CassandraProducer.java:55) 
        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) 
        at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3275) 
        at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1243) 
        at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1204) 
        at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:442) 
        ... 73 more
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier col09
        at com.datastax.driver.core.Responses$Error.asException(Responses.java:102) 
        at com.datastax.driver.core.SessionManager$4.apply(SessionManager.java:205) 
        at com.datastax.driver.core.SessionManager$4.apply(SessionManager.java:182)

0 个答案:

没有答案