问题描述
我正在尝试使用以下控制台在本地计算机上运行查询
I am trying to run the query form my local machine using console as below
select state from table limit 10 ALLOW FILTERING;
它给了我输出.
但是当我尝试使用控制台应用程序时,没有得到任何结果.
下面是代码
But when I am trying it form console application I am not getting any result.
Below is the code
//Create a cluster instance using 3 cassandra nodes.
var cluster = Cluster.Builder()
.AddContactPoints("xx.xx.xx.xx")
.Build();
var session = cluster.Connect("keyspace");
var rs = session.Execute("select state from table limit 10 ALLOW FILTERING");
foreach (var row in rs)
{
var value = row.GetValue<string>("state");
}
参考: https://docs.datastax.com/en/开发人员/csharp-driver/3.2/
我也没有收到任何错误.我正在使用"CassandraCSharpDriver"
https://www.nuget.org/packages/CassandraCSharpDriver/
推荐答案
我发现了驱动程序版本存在问题的解决方案.我使用的是默认的最新版本.
我降级到3.11.0并开始工作.
I found the solution the issue is with the driver version. I was using the latest version which is the default.
I downgraded to 3.11.0 and started working.
我的服务器版本为[cqlsh 5.0.1 |卡桑德拉3.11.4 |CQL规范3.4.4 |原生协议v4]
My server version is [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
这篇关于查询Cassandra表单C#,未显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!