Cassandra API等效于“SELECT ... FROM ... WHERE id IN('...','...','...'); [英] Cassandra API equivalent of "SELECT ... FROM ... WHERE id IN ('...', '...', '...');"
本文介绍了Cassandra API等效于“SELECT ... FROM ... WHERE id IN('...','...','...');的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设以下资料集:
id age city phone
== === ==== =====
alfred 30 london 3281283
jeff 43 sydney 2342734
joe 29 tokyo 1283881
kelly 54 new york 2394929
molly 20 london 1823881
rob 39 sydney 4928381
要获得以下结果集..
To get the following result set ..
id age phone
== === =====
alfred 30 3281283
joe 29 1283881
molly 20 1823881
..使用SQL会发出..
.. using SQL one would issue ..
SELECT id, age, phone FROM dataset WHERE id IN ('alfred', 'joe', 'molly');
在一个命令中会产生相同结果集的对应Cassandra API调用是什么?
What is the corresponding Cassandra API call that would yield the same result set in one command?
推荐答案
CQL(Cassandra的类似SQL的查询语言)现在支持:
CQL (Cassandra's SQL-like query language) now supports this:
SELECT ... WHERE keyalias IN ('key1', 'key2', 'key3', ...);
http://cassandra.apache.org/doc/cql/CQL.html#Filteringrows
这篇关于Cassandra API等效于“SELECT ... FROM ... WHERE id IN('...','...','...');的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文