I'm trying to insert some rows into a Cassandra (1.2.16) database with CQL, but the Datastax API call is being rejected. The query is created through a PreparedStatement
and executed with a BoundStatement
like so
session.Execute (boundStatement);
// query is
INSERT INTO "KeyspaceName.ColumnFamilyName" (key, column1, value) VALUES (?, ?, ?)
It gets rejected with
Caught an exception Cassandra.InvalidQueryException: unconfigured columnfamily KeyspaceName.ColumnFamilyName
// which happens at the Execute call above
However, I can see that the column family does exist
var cluster = Cluster.Builder ()
.AddContactPoint ("127.0.0.1")
.Build ();
new List<string> (cluster.Metadata.GetKeyspaces ()).ForEach ((value) => {
Console.WriteLine ("Keyspace: " + value);
new List<string> (cluster.Metadata.GetKeyspace(value).GetTablesNames()).ForEach((tableName) => {
Console.WriteLine("Table: " + tableName);
});
});
which prints (among others)
Keyspace: KeyspaceName
Table: ColumnFamilyName
So the column family is there.
Why can't Cassandra find the table/column family when executing the CQL INSERT
query? Is this a version issue? I'm under the impression that newer versions of CQL refer to column families as tables. How should I configure the table?