- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 197字
- 2021-07-03 00:19:31
Retrieving all the rows
Perhaps we'd like to expand our administrative interface to show a list of all the users who've signed up for MyStatus. To do this, we'll want to simply ask Cassandra for all the user records:
SELECT * FROM "users";
Since we omitted the WHERE portion of the query, Cassandra will simply return all rows in the users table:
If you've been following along with the examples, you'll see that the latest query returns both rows that we've inserted into the database. However, had we inserted over 10,000 rows, we'd notice that only 10,000 rows would be returned. This is a limit built into cqlsh; using a language driver, you can retrieve result sets of arbitrary size.
You'll also notice that bob is returned before alice. Clearly, rows are not returned in lexical order of their primary key. As it happens, in a table with a single primary key column, row ordering is deterministic but not defined from a client standpoint. Deterministic ordering is enough, however, to allow us to page through very large result sets.
You'll find a full reference for the SELECT statement in the DataStax CQL documentation at http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html.
- Big Data Analytics with Hadoop 3
- ABB工業機器人編程全集
- Google Cloud Platform Cookbook
- Excel 2007函數與公式自學寶典
- Learning Social Media Analytics with R
- 數據產品經理:解決方案與案例分析
- 工業機器人工程應用虛擬仿真教程:MotoSim EG-VRC
- Visual C# 2008開發技術詳解
- 網絡組建與互聯
- ESP8266 Home Automation Projects
- 水下無線傳感器網絡的通信與決策技術
- 內??刂萍捌鋺?/a>
- 網站入侵與腳本攻防修煉
- Mastering pfSense
- 計算機組裝與維修實訓