运行 SAI 示例返回 SyntaxException,“输入‘OR’时没有可行的替代方案”

问题描述 投票:0回答:1

按照cassandra的sai例子进行OR运算时出现错误

版本:[cqlsh 6.2.0 |卡桑德拉 5.0-beta1 | CQL 规范 3.4.7 |本机协议 v5]

    CREATE TABLE IF NOT EXISTS cycling.comments_vs (
      record_id timeuuid,
      id uuid,
      commenter text,
      comment text,
      comment_vector VECTOR <FLOAT, 5>,
      created_at timestamp,
      PRIMARY KEY (id, created_at)
    )
    WITH CLUSTERING ORDER BY (created_at DESC);
    CREATE INDEX commenter_idx
        ON cycling.comments_vs (commenter)
        USING 'sai';
    CREATE INDEX created_at_idx
        ON cycling.comments_vs (created_at)
        USING 'sai';
    CREATE INDEX ann_index
        ON cycling.comments_vs (comment_vector)
        USING 'sai';


    cqlsh> SELECT * FROM cycling.comments_vs
       ...     WHERE
       ...     created_at='2017-03-21 21:11:09.999000+0000'
       ...     OR created_at='2017-03-22 01:16:59.001000+0000';
    SyntaxException: line 4:4 no viable alternative at input 'OR' (...cycling.comments_vs    WHERE    created_at='2017-03-21 21:11:09.999000+0000'    [OR]...)

为什么

SELECT
命令会出现该错误?

cassandra cql
1个回答
0
投票

SELECT
OR
运算符上引发该异常。存储附加索引 (SAI) 实现的功能已分为版本 1 和版本 2。对
OR
运算符的支持位于 版本 2,看起来我们将在 Cassandra 5.1 中看到它。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.