cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [04/10] cassandra git commit: Add warning regarding quoted identifiers in CQL doc
Date Mon, 18 Jan 2016 10:28:30 GMT
Add warning regarding quoted identifiers in CQL doc


Branch: refs/heads/trunk
Commit: 79b9492363d60863c717a9dfe4ce8c1769071c85
Parents: 1b59357
Author: Sylvain Lebresne <>
Authored: Mon Jan 18 11:27:24 2016 +0100
Committer: Sylvain Lebresne <>
Committed: Mon Jan 18 11:27:24 2016 +0100

 doc/cql3/CQL.textile | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index c2ecbd7..2dd96e7 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -46,6 +46,8 @@ p. Identifiers and (unquoted) keywords are case insensitive. Thus @SELECT@
is th
 p. There is a second kind of identifiers called _quoted identifiers_ defined by enclosing
an arbitrary sequence of characters in double-quotes(@"@). Quoted identifiers are never keywords.
Thus @"select"@ is not a reserved keyword and can be used to refer to a column, while @select@
would raise a parse error. Also, contrarily to unquoted identifiers and keywords, quoted identifiers
are case sensitive (@"My Quoted Id"@ is _different_ from @"my quoted id"@). A fully lowercase
quoted identifier that matches @[a-zA-Z]@@[a-zA-Z0-9_]@@*@ is equivalent to the unquoted identifier
obtained by removing the double-quote (so @"myid"@ is equivalent to @myid@ and to @myId@ but
different from @"myId"@). Inside a quoted identifier, the double-quote character can be repeated
to escape it, so @"foo "" bar"@ is a valid identifier.
+p. *Warning*: _quoted identifiers_ allows to declare columns with arbitrary names, and those
can sometime clash with specific names used by the server. For instance, when using conditional
update, the server will respond with a result-set containing a special result named @"[applied]"@.
If you've declared a column with such a name, this could potentially confuse some tools and
should be avoided. In general, unquoted identifiers should be preferred but if you use quoted
identifiers, it is strongly advised to avoid any name enclosed by squared brackets (like @"[applied]"@)
and any name that looks like a function call (like @"f(x)"@).
 h3(#constants). Constants
 CQL defines the following kind of _constants_: strings, integers, floats, booleans, uuids
and blobs:

View raw message