使用Cassandra.Session中的方法时:
/// <summary>
/// Prepares the provided query string.
/// </summary>
/// <param name="cqlQuery">cql query to prepare</param>
PreparedStatement Prepare(string cqlQuery);
内部抛出异常:
Message: A first chance exception of type 'System.ArgumentException' occurred in Cassandra.dll
Additional information: Column column_aliases not found
Cassandra.dll!Cassandra.Row.GetValue<string>(string name) Unknown
Cassandra.dll!Cassandra.KeyspaceMetadata.GetTableMetadata(string tableName) Unknown
Cassandra.dll!Cassandra.Metadata.GetTable(string keyspace, string tableName) Unknown
Cassandra.dll!Cassandra.Session.SetPrepareTableInfo(System.Threading.Tasks.Task<Cassandra.PreparedStatement> t) Unknown
Cassandra.dll!Cassandra.Tasks.TaskHelper.DoNext<Cassandra.PreparedStatement,Cassandra.PreparedStatement>(System.Threading.Tasks.Task<Cassandra.PreparedStatement> task, System.Func<System.Threading.Tasks.Task<Cassandra.PreparedStatement>,Cassandra.PreparedStatement> next) Unknown
Cassandra.dll!Cassandra.Tasks.TaskHelper.Continue<Cassandra.PreparedStatement,Cassandra.PreparedStatement>.AnonymousMethod__9(System.Threading.Tasks.Task<Cassandra.PreparedStatement> innerTask) Unknown
因此,未设置准备好的查询的路由键,我必须手动设置它们。以下是日志的消息:
Cassandra.Session: 08-18-2015 14:21:38.367 +02:00 #ERROR: There was an error while trying to retrieve table metadata for mykeyspace.mytable.
System.ArgumentException: Column column_aliases not found
in Cassandra.Row.GetValue[T](String name)
in Cassandra.KeyspaceMetadata.GetTableMetadata(String tableName)
in Cassandra.Metadata.GetTable(String keyspace, String tableName)
in Cassandra.Session.SetPrepareTableInfo(Task`1 t)
Cassandra.Session: 08-18-2015 14:21:38.369 +02:00 : Routing information could not be set for query "INSERT INTO mytable (x, y, z, k, a) VALUES (?, ?, ?, ?, ?)"
如何解决这个问题?
我正在使用:
答案 0 :(得分:1)
您应该使用完全支持Apache Cassandra 2.2的DataStax C#驱动程序的v2.6 +。