如何使用CQL 3.0与JDBC驱动程序或Hector [英] How to use CQL 3.0 with JDBC drivers or Hector

查看:171
本文介绍了如何使用CQL 3.0与JDBC驱动程序或Hector的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用cassandra 1.1.1。但是,每当我使用复合键创建列族时,我会收到以下错误:

I am using cassandra 1.1.1. But, whenever I create a column family with composite keys, I will get an error as below,

java.sql.SQLSyntaxErrorException: line 1:117 mismatched input ')' expecting EOF 
at org.apache.cassandra.cql.jdbc.CassandraStatement.
                                          doExecute(CassandraStatement.java:180) 
at org.apache.cassandra.cql.jdbc.CassandraStatement.executeUpdate(
                                                    CassandraStatement.java:237) 
at jdbc.cassandra.JdbcCassandra.main(JdbcCassandra.java:59)

我的查询是 CREATE TABLE sblocks(block_id uuid,subblock_id uuid,data blob,PRIMARY KEY(block_id,subblock_id));

一些身体能帮助我吗? / p>

Can some body help me out?

推荐答案

您暗示您的问题标题中的答案:您的连接可能实际上不使用CQL版本3.使用版本3必须明确请求语法。

You alluded to the answer in your question title: your connection probably is not actually using CQL version 3. Use of the version 3 syntax has to be explicitly requested.

最新版本的JDBC驱动程序尚不支持请求CQL 3.然而,'trunk'分支中的版本确实,你不介意生活在JDBC驱动程序边缘。

The latest version of the JDBC driver does not yet support requesting CQL 3. The version in the 'trunk' branch does, though, if you don't mind living on the JDBC driver edge.

此提交的更改日志: http:// code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/browse/src/main/java/org/apache/cassandra/cql/jdbc/CassandraConnection.java?name=trunk说明如何使用它。

The changelog on this commit: http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/browse/src/main/java/org/apache/cassandra/cql/jdbc/CassandraConnection.java?name=trunk explains how to use it.

这篇关于如何使用CQL 3.0与JDBC驱动程序或Hector的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆