Cassandra version: 2.2.0
I have Cassandra table like below:
app_id | ts | os_name
----------------------------------+--------------------------+-----------
bb61ffae3b8f73e61572b61450d6d5d6 | 2015-08-04 22:00:00-0700 | Android
bb61ffae3b8f73e61572b61450d6d5d6 | 2015-08-05 22:00:00-0700 | Android
and when I "select app_id as appID", the returned column name is all lower-case.
cqlsh:myDB> SELECT app_id as appID FROM daily_activity_report limit 10;
Then I got:
appid
----------------------------------
bb61ffae3b8f73e61572b61450d6d5d6
7b87263e57a34deccb462b26786896b3
In my query I'm specifying upper-case "SELECT distinct app_id as appID", but returned is lower-case "appid".
Is there any config variable I'm missing to enable case sensitive column name? How to make it case sensitive?
Thanks a lot.
update: I also tried to add quote to the column name 'appID' as below, but no luck.
cqlsh:myDB> SELECT app_id as 'appID' FROM daily_activity_report limit 10;
response:
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query]
message="line 1:26 no viable alternative at input 'appID' (SELECT distinct app_id as ['appI]...)">
From the DataStax documentation,
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.
http://docs.datastax.com/en/cql/3.0/cql/cql_reference/ucase-lcase_r.html
Using double quotes instead of single quotes should work for you.