Unsupported consistency level: LOCAL_QUORUM. Supported consistency levels for Search are: ONE, LOCAL_ONE

huangapple go评论91阅读模式
英文:

Unsupported consistency level: LOCAL_QUORUM. Supported consistency levels for Search are: ONE, LOCAL_ONE

问题

我在使用cqlsh查询DSE 6.7时遇到了一个问题。

无效请求:服务器错误:code=2200 [无效查询] message="不支持的一致性级别:LOCAL_QUORUM。支持的搜索一致性级别为:ONE、LOCAL_ONE"。

我的查询非常简单:

查询:

select * from esc shipment . shipment search where shipper id like '1334';

我花了很多时间在谷歌上搜索,但没有找到与我的情况相同的用例。

有人能告诉我主要原因以及如何解决这个问题吗?
我是一个非常初学者。

英文:

I faced an issue when using cqlsh to query on dse 6.7.

Invalid Request: Error from server: code=2200 [Invalid query] message="Unsupported consistency level: LOCAL_QUORUM. Supported consistency levels for Search are: ONE, LOCAL_ONE".

My query is very simple is:

Query :

select * from esc shipment . shipment search where shipper id like '1334';

I spent a lot of time to google but I did not find any use case same same my case.

Could anyone tell me the main reason and how to fix this issue.
I'm a very beginner.

答案1

得分: 1

问题如下 - 您正在对启用了 DSE 搜索的表上使用 LIKE 运算符运行查询。因为 CQL 没有 LIKE 运算符,所以此查询会被卸载到 DSE 搜索,DSE 搜索只能使用一致性级别 ONELOCAL_ONE 来回答查询(正如错误中指出的那样 - 这是 DSE 搜索的已知限制)。

您需要使用 cqlsh 命令 CONSISTENCY 更改一致性级别,像这样:

CONSISTENCY LOCAL_ONE

然后重新执行查询。

英文:

The problem is following - you're running your query with LIKE operator on the table that has DSE Search enabled. Because CQL doesn't have LIKE operator, this query is offloaded to the DSE Search that is able to answer queries only with consistency level ONE or LOCAL_ONE (as it's pointed in the error - it's a known limitation of DSE Search).

You need to change consistency level with the cqlsh command CONSISTENCY, lie this:

CONSISTENCY LOCAL_ONE

and then execute the query again.

huangapple
  • 本文由 发表于 2020年10月7日 17:23:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/64241059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定