- 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 ] )*
推薦閱讀
- 大數據導論:思維、技術與應用
- Microsoft Dynamics CRM Customization Essentials
- Mastering Spark for Data Science
- Learning Apache Cassandra(Second Edition)
- 機器學習流水線實戰
- JSP從入門到精通
- Mastering Text Mining with R
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- 常用傳感器技術及應用(第2版)
- 大數據素質讀本
- Visual Basic項目開發案例精粹
- Hands-On Business Intelligence with Qlik Sense
- Windows 7故障與技巧200例
- Python語言從入門到精通
- Keras Reinforcement Learning Projects