cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-4241) avoid hardcoding datatypes in CQL3 grammar
Date Sat, 12 May 2012 08:15:51 GMT


Sylvain Lebresne commented on CASSANDRA-4241:

I'll note that in fact the first version of CQL3 didn't had the data types hardcoded in the
grammar and I added them afterwards. My vague justification for that was for documentation
purpose of the grammar itself (if someone wants to write a CQL tool and wants to check the
detailed grammar, the more it can do by just looking a Cql.g, the better).

The way this currently works, a type is either a native type, or a string litteral (in which
case it is a custom type, and custom types *are* supported (as they are in CQL2)). I do like
the idea to have a syntactic distinction between native and custom types (namely whether the
name is within quotes). I think it makes the syntax slightly more regular. And that part would
actually be slightly annoying to do with post-parser validation (because currently the distinction
is enforce by the parser, but after that it's all "Strings", we've lost whether it was enclosed
in quotes or not).

Anyway, that's minor details but just wanted to mention that I did though of it and I have
a slight preference for the way it is (the fact that we have to update 2 places is imo a non-issue
in that specific case, we won't add new datatypes every other day).
> avoid hardcoding datatypes in CQL3 grammar
> ------------------------------------------
>                 Key: CASSANDRA-4241
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1.1
> Currently adding a new datatype requires editing Cql.g as well as CFPropDefs.  ISTM we
can omit data type knowledge from the parser and just use \w+, and let our post-parser code
reject invalid datatypes.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message