You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Vinuraj M (JIRA)" <ji...@apache.org> on 2013/01/21 14:26:12 UTC

[jira] [Updated] (CASSANDRA-5177) Insert on column with composite partition key fails with java.lang.IllegalStateException Cannot acces column family with composite key from CQL < 3.0.0

     [ https://issues.apache.org/jira/browse/CASSANDRA-5177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vinuraj M updated CASSANDRA-5177:
---------------------------------

    Priority: Critical  (was: Blocker)
    
> Insert on column with composite partition key fails with java.lang.IllegalStateException  Cannot acces column family with composite key from CQL < 3.0.0
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5177
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5177
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Drivers
>    Affects Versions: 1.2.0
>         Environment: Linux 2.6.18-194.el5 x86_64 GNU/Linux
>            Reporter: Vinuraj M
>            Priority: Critical
>
> Even though the version is set at JDBC driver level, thrift doesn't seem to get that.
> What steps will reproduce the problem?
> 1. Create a table as below
> CREATE TABLE perflog (
> 	pp text,
> 	mon text,
> 	dts timestamp,
> 	val double,
> 	sts text,
> 	PRIMARY KEY((pp,mon),dts)
> );
> 2. Java code to connect to database as below.
> Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver");
> Connection c = DriverManager.getConnection("jdbc:cassandra://localhost:9160/db1?version=3.0.0");
> This is successful with below message
> Connected to localhost:9160 using Keyspace db1 and CQL version 3.0.0
> 3.Insert into table with prepared statement
> What is the expected output? What do you see instead?
> Successful insert.
> Instead following errors is show in server side log.
> ERROR [Thrift:14] 2013-01-18 18:33:54,394 CustomTThreadPoolServer.java (line 217) Error occurred during processing of message.
> java.lang.IllegalStateException: Cannot acces column family with composite key from CQL < 3.0.0
>         at org.apache.cassandra.config.CFMetaData.getKeyName(CFMetaData.java:502)
>         at org.apache.cassandra.cql.QueryProcessor.validateKeyAlias(QueryProcessor.java:293)
>         at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:149)
>         at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:127)
>         at org.apache.cassandra.cql.QueryProcessor.processStatement(QueryProcessor.java:532)
>         at org.apache.cassandra.cql.QueryProcessor.processPrepared(QueryProcessor.java:827)
>         at org.apache.cassandra.thrift.CassandraServer.execute_prepared_cql_query(CassandraServer.java:1761)
>         at org.apache.cassandra.thrift.Cassandra$Processor$execute_prepared_cql_query.getResult(Cassandra.java:4140)
>         at org.apache.cassandra.thrift.Cassandra$Processor$execute_prepared_cql_query.getResult(Cassandra.java:4128)
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
>         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
>         at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:199)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> What version of the product are you using? On what operating system?
> [cqlsh 2.3.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
> Please provide any additional information below.
> Following jar files are used.
> libthrift-0.7.0.jar
> cassandra-jdbc-1.1.2.jar
> apache-cassandra-clientutil-1.2.0.jar
> guava-13.0.1.jar
> apache-cassandra-thrift-1.2.0.jar
> I have actually tried with cqlsh and the insert is working fine. This happens when I use the JDBC driver hence I thought it is a problem with the driver and created a defect there, but they suggested creating a defect at Cassandra JIRA. I get a different error at my java program i wrote for loading data using JDBC driver which is as below
> java.sql.SQLNonTransientConnectionException
> 	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.doExecute(CassandraPreparedStatement.java:171)
> 	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.executeUpdate(CassandraPreparedStatement.java:208)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira