CQL for Apache Cassandra™ 1.2 (Not supported)
CQL for Apache Cassandra™ 2.2 and 3.x
All Posts - Datastax Community
区分大小写,双引号括起来
cqlsh:store> CREATE TABLE "TEST"(Foo int PRIMARY KEY ,"Bar" int);
cqlsh:store> DESC TABLES
"TEST" shopping_cart
cqlsh:store> CREATE TABLE TEST(Foo int PRIMARY KEY ,"Bar" int);
cqlsh:store> DESC TABLES
"TEST" test shopping_cart
cqlsh:store>
Uppercase and lowercase
Keyspace, column, and table names created using CQL 3 are case-insensitive unless enclosed in double quotation marks. If you enter names for these objects using any uppercase letters, Cassandra stores the names in lowercase. You can force the case by using double quotation marks. For example:
CREATE TABLE test ( Foo int PRIMARY KEY, "Bar" int );
The following table shows soem examples of partial queries that work and do not work to return results from the test table:
| Queries that Work | Queries that Don't Work |
| SELECT foo FROM . . . | SELECT "Foo" FROM . . . |
| SELECT Foo FROM . . . | SELECT "BAR" FROM . . . |
| SELECT FOO FROM . . . | SELECT bar FROM . . . |
| SELECT "foo" FROM . . . | SELECT Bar FROM . . . |
| SELECT "Bar" FROM . . . |
SELECT "foo" FROM ... works because internally, Cassandra stores foo in lowercase. The double-quotation mark character can be used as an escape character for the double quotation mark.
Case sensitivity rules in earlier versions of CQL apply when handling legacy tables.
CQL keywords are case-insensitive. For example, the keywords SELECT and select are equivalent. This document shows keywords in uppercase.
ApacheCassandra的CQL命令中,表名和列名在不使用双引号时是不区分大小写的,内部会存储为小写。创建和查询时,使用双引号可以强制保持大小写。关键词、列名和表名在早期版本的CQL中遵循不同的大小写规则。CQL关键词本身是不区分大小写的。

1871

被折叠的 条评论
为什么被折叠?



