我是卡桑德拉世界的新手。我使用 cqlsh 创建了一个 cassandra 表,如下所示:
CREATE TABLE "userRecommendations" (uid text PRIMARY KEY, app set<text>);
现在,当我使用 cassandra-cli 并执行 adescribe keySpace;
时,我得到
[default@keySpace] describe userRecommendations;
ColumnFamily: userRecommendations
Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
Default column value validator: org.apache.cassandra.db.marshal.BytesType
Columns sorted by: org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.ColumnToCollectionType(617070:org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)))
GC grace seconds: 0
Compaction min/max thresholds: 0/0
Read repair chance: 0.0
DC Local Read repair chance: 0.0
Populate IO Cache on flush: false
Replicate on write: false
Caching: keys_only
Bloom Filter FP chance: default
Built indexes: []
Compaction Strategy: null
null
然后,如果我对列族执行 GET,我会得到一个异常。
[default@UserInfo] get userRecommendations[utf8('aparna')][utf8('app')];
Not enough bytes to read value of component 0
InvalidRequestException(why:Not enough bytes to read value of component 0)
at org.apache.cassandra.thrift.Cassandra$get_result.read(Cassandra.java:6592)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_get(Cassandra.java:556)
at org.apache.cassandra.thrift.Cassandra$Client.get(Cassandra.java:541)
at org.apache.cassandra.cli.CliClient.executeGet(CliClient.java:723)
at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:210)
at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:210)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:337)
我做错了什么?
提前非常感谢!