问题 - 我能够在 CQL2 中不存在的列值上使用 select 语句检索结果(但这在 CQL3 中不会发生);谁可以给我解释一下这个 ?
你明白为什么我会在我的选择查询中得到一个不存在 C0 列值 ('test') 的结果吗?我不明白 - 见下文:一定有什么错误配置,但是什么?
cqlsh> use Keyspace1;
cqlsh:Keyspace1> CREATE COLUMNFAMILY users (
... KEY varchar PRIMARY KEY,
... gender varchar,
... birth_year bigint);
cqlsh:Keyspace1> INSERT INTO users (KEY, gender, birth_year) VALUES ('TEST', 'm', 1968);
cqlsh:Keyspace1> select * from users;
KEY | birth_year | gender
------+------------+--------
TEST | 1968 | m
cqlsh:Keyspace1> select * from users where key = 'TEST';
KEY | birth_year | gender
------+------------+--------
TEST | 1968 | m
cqlsh:Keyspace1> CREATE INDEX birth_year_key ON users (birth_year);
cqlsh:Keyspace1> CREATE INDEX gender_key ON users (gender);
cqlsh:Keyspace1> select * from users where key = 'TEST' and birth_year = 1968;
KEY | birth_year | gender
------+------------+--------
TEST | 1968 | m
cqlsh:Keyspace1> select * from users where birth_year = 1968;
KEY | birth_year | gender
------+------------+--------
TEST | 1968 | m
到目前为止,一切都很好,但现在看:
cqlsh:Keyspace1> select * from users where key = 'TEST' and birth_year = 1962;
KEY | birth_year | gender
------+------------+--------
TEST | 1968 | m
这里发生了什么 ?谢谢,马特