cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Resolved] (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
Date Mon, 21 Jan 2013 14:48:13 GMT


Sylvain Lebresne resolved CASSANDRA-5177.

    Resolution: Duplicate

This is a problem that in fact needs to be fixed in the jdbc driver, in the sense that it
doesn't seem to have been updated for cassandra 1.2 (that have new and dedicated thrift methods
for CQL3). That being said, Cassandra should obviously not silently accept the connection
and latter do the wrong thing (basically interpreting everything as CQL2) and that part is
fixed by CASSANDRA-5172.
> 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:
>             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 (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(
>         at org.apache.cassandra.cql.QueryProcessor.validateKeyAlias(
>         at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(
>         at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(
>         at org.apache.cassandra.cql.QueryProcessor.processStatement(
>         at org.apache.cassandra.cql.QueryProcessor.processPrepared(
>         at org.apache.cassandra.thrift.CassandraServer.execute_prepared_cql_query(
>         at org.apache.cassandra.thrift.Cassandra$Processor$execute_prepared_cql_query.getResult(
>         at org.apache.cassandra.thrift.Cassandra$Processor$execute_prepared_cql_query.getResult(
>         at org.apache.thrift.ProcessFunction.process(
>         at org.apache.thrift.TBaseProcessor.process(
>         at org.apache.cassandra.thrift.CustomTThreadPoolServer$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> 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(
> 	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.executeUpdate(

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:

View raw message