我在 cassandra 中非常天真并且正在使用 astyanax
CREATE TABLE 员工(empID int、deptID int、first_name varchar、last_name varchar、PRIMARY KEY (empID, deptID));
我想获取查询的值: select * from employees where empID =2 and deptID = 800;
public void read(Integer empID, String deptID) {
OperationResult<ColumnList<String>> result;
try {
columnFamilies = ColumnFamily.newColumnFamily("employees", IntegerSerializer.get(), StringSerializer.get());
result = keyspace.prepareQuery(columnFamilies).getKey(empID).execute();
ColumnList<String> cols = result.getResult();
//Other stuff
}
我应该如何做到这一点