- Hands-On Big Data Modeling
- James Lee Tao Wei Suresh Kumar Mukhiya
- 278字
- 2021-06-10 18:58:54
Cassandra Query Language (CQL)
CQL is very similar to the SQL used in a traditional database, such as MySQL and Postgre. CQL is implemented as an alternative to the traditional RPC interface. It provides a model close to SQL, in the sense that data is put into tables containing rows of columns. For that reason, when used in this chapter these terms (tables, rows, and columns) have the same definitions that they have in SQL.
CQL appends an abstraction layer that masks the implementation details of its query structure, and presents a native syntax for collections and common encodings. For example, a common syntax for selecting data from a table is given as follows:
select_statement ::= SELECT [ JSON | DISTINCT ] ( select_clause | '*' )
FROM table_name
[ WHERE where_clause ]
[ GROUP BY group_by_clause ]
[ ORDER BY ordering_clause ]
[ PER PARTITION LIMIT (integer | bind_marker) ]
[ LIMIT (integer | bind_marker) ]
[ ALLOW FILTERING ]
select_clause ::= selector [ AS identifier ] ( ',' selector [ AS identifier ] )
selector ::= column_name
| term
| CAST '(' selector AS cql_type ')'
| function_name '(' [ selector ( ',' selector )* ] ')'
| COUNT '(' '*' ')'
where_clause ::= relation ( AND relation )*
relation ::= column_name operator term
'(' column_name ( ',' column_name )* ')' operator tuple_literal
TOKEN '(' column_name ( ',' column_name )* ')' operator term
operator ::= '=' | '<' | '>' | '<=' | '>=' | '!=' | IN | CONTAINS | CONTAINS KEY
group_by_clause ::= column_name ( ',' column_name )*
ordering_clause ::= column_name [ ASC | DESC ] ( ',' column_name [ ASC | DESC ] )*
推薦閱讀
- 大數據項目管理:從規劃到實現
- 機器學習及應用(在線實驗+在線自測)
- 圖形圖像處理(Photoshop)
- 大數據改變世界
- PHP開發手冊
- 21天學通Java
- INSTANT Autodesk Revit 2013 Customization with .NET How-to
- Learn CloudFormation
- Enterprise PowerShell Scripting Bootcamp
- 水下無線傳感器網絡的通信與決策技術
- 人工智能:語言智能處理
- 奇點將至
- 水晶石影視動畫精粹:After Effects & Nuke 影視后期合成
- INSTANT VMware vCloud Starter
- FANUC工業機器人配置與編程技術