1

在 Cassandra Cluster EVENT_KS Key Space 中,我有一个 bookTicket1(流),它有列 payload_provider、payload_totalNoTickets。当我尝试如下新的分析脚本时,

CREATE EXTERNAL TABLE IF NOT EXISTS BusTicketTable 
(provider STRING, totalNoTickets STRING,  version STRING) 
STORED BY 'org.apache.hadoop.hive.cassandra.CassandraStorageHandler'
WITH SERDEPROPERTIES ( 
"cassandra.host" = "127.0.0.1" , 
"cassandra.port" = "9160" , 
"cassandra.ks.name" = "EVENT_KS" , 
"cassandra.ks.username" = "admin" , 
"cassandra.ks.password" = "admin" , 
"cassandra.cf.name" = "bookTicket1" , 
"cassandra.columns.mapping" = ":payload_provider,payload_totalNoTickets, Version" );   

它返回错误:

错误:执行 Hive 脚本时出错。查询返回非零代码:9,原因:失败:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1“

4

1 回答 1

1

考虑这条线,

"cassandra.columns.mapping" = ":payload_provider,payload_totalNoTickets, Version"

Cassandra 中没有设置密钥。我不确定,但我认为您可能还必须设置键,因为行键对于 Cassandra 列族是必需的。

例如:"cassandra.columns.mapping" = ":key, payload_provider,payload_totalNoTickets, Version"

您可能需要将唯一字段设置为键。

于 2013-01-30T06:28:37.240 回答