相关疑难解决方法(0)

如果表具有SET类型列,则Cassandra IN查询无效

我是Cassandra的新手.我遇到了一个问题CQL IN query,如果表有SET类型列它可以工作.

CREATE TABLE test (
    test_date bigint, 
    test_id bigint, 
    caption text,
    PRIMARY KEY(test_date,test_id)
);

select * from test where test_date = 2022015 and test_id IN (1,2);
Run Code Online (Sandbox Code Playgroud)

但如果我添加上面设置的标签,那么它会给出错误

CREATE TABLE test1 (
    test_date bigint, 
    test_id bigint, 
    tags set<text>,
    caption text,
    PRIMARY KEY(test_date,test_id)
);

select * from test1 where test_date = 2022015 and test_id IN (1,2);
Run Code Online (Sandbox Code Playgroud)

code = 2200 [无效查询] message ="无法通过IN关系限制列"test_id",因为查询选择了一个集合"

cql cassandra

9
推荐指数
1
解决办法
2464
查看次数

标签 统计

cassandra ×1

cql ×1