0
在卡桑德拉,您可以添加和使用新列像这样的表:如何寻找一个表,一个未定义的列
cqlsh:mysite> CREATE TABLE mytable (
url timeuuid,
PRIMARY KEY (url)
);
cqlsh:mysite> ALTER TABLE mytable ADD tag_tagX text;
cqlsh:mysite> INSERT INTO mytable (url) VALUES (now());
cqlsh:mysite> SELECT * from mytable;
url | tag_tagx
--------------------------------------+----------
ad47de80-8a2c-11e4-8ab4-eb66c236961e | null
(1 rows)
cqlsh:mysite> CREATE INDEX ON mytable(tag_tagX);
cqlsh:mysite> SELECT * FROM mytable WHERE tag_tagX = null;
code=2200 [Invalid query] message="Unsupported null value for indexed column tag_tagx"
自卡桑德拉让行的INSERT语句中不指定某些列,怎么能我们选择没有此列的行已使用?
可能的[如何搜索使用CQL的空/空字段的记录?](http://stackoverflow.com/questions/20981075/how-can-i-search-for-records-that -have-a-null-empty-field-using-cql) – AlexMeng
@AlexMeng:我没有重新回顾问题标题,我修正了它,谢谢。你的链接的答案是相似的,但没有关注面对这种情况时应采取的解决方法......我们如何创建一个SELECT来搜索列中不包含任何值的行? – Alain
您无法在Cassandra中选择null的值。你将不得不解决它。 – AlexMeng