我有一个Java语言代码,我正在使用Hypertable的一个例子,但我有一个错误。
代码是:
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import org.hypertable.thrift.*;
import org.hypertable.thriftgen.*;
public class HypertableJDBCTester
{
public static void main(String[] args) throws Exception
{
ThriftClient client = null;
long ns = -1;
Schema schema = new Schema();
HqlResult resultQuery = null;
HqlResultAsArrays result_as_arrays = null;
try {
client = ThriftClient.create("localhost", 38080);
if (!client.namespace_exists("test"))
client.namespace_create("test");
ns = client.namespace_open("test");
client.table_drop(ns, "Fruits", true);
client.table_create(ns, "Fruits", schema);
Map column_families = new HashMap();
ColumnFamilySpec cf = new ColumnFamilySpec();
cf.setName("genus");
column_families.put("genus", cf);
cf = new ColumnFamilySpec();
cf.setName("tag");
column_families.put("tag", cf);
cf = new ColumnFamilySpec();
cf.setName("description");
column_families.put("description", cf);
schema.setColumn_families(column_families);
resultQuery = client.hql_exec(ns, "INSERT INTO Fruits VALUES ('strawberry','genus', 'Fragaria')", true, false);
result_as_arrays = client.hql_query_as_arrays(ns, "SELECT * from Fruits WHERE ROW = 'lemon'");
for (List<String> cell_as_array : result_as_arrays.cells)
System.out.println(cell_as_array.subList(0, 4));
client.namespace_close(ns);
}
catch (ClientException e) {
System.out.println(e.message);
System.exit(1);
}
}
}
输出
HYPERTABLE bad key - namespace=1791095845 hql=INSERT INTO Fruits VALUES ('strawberry','genus', 'Fragaria') noflush=1 unbuffered=0.
我的问题是什么?