我使用 cql 3 创建了一个如下表(使用 Cassandra 1.1.12)
Create table User (
... userid varchar,
... password varchar,
... email varchar,
... gender varchar,
... fullName varchar,
... dateOfBirth varchar,
... bloodGroup varchar,
... ethnicity varchar,
... PRIMARY KEY (userid)
... );
但是使用 hector api,我无法在列族中插入数据。
Mutator<String> mutator = HFactory.createMutator(emr, ss);
System.out.println("Inserting");
mutator.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(FULL_NAME, user.getFullName()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(EMAIL, user.getEmail()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(DOB, user.getDateOfBirth()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(BLOOD_GROUP, user.getBloodGroup()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(PASSWORD, user.getPassword()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(ETHNICITY, user.getEthnicity()))
.addInsertion(user.getUserID(), USER, HFactory.createStringColumn(GENDER, user.getGender()));
mutator.execute();
它给出以下错误
线程“主”me.prettyprint.hector.api.exceptions.HInvalidRequestException 中的异常:InvalidRequestException(为什么:未配置的 columnfamily 用户)
有人可以帮忙吗?