[ 
https://issues.apache.org/jira/browse/CASSANDRA-6120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13801829#comment-13801829
 ] 

Sylvain Lebresne commented on CASSANDRA-6120:
---------------------------------------------

Not really sure what to do here. The "inconsistency" is not just for boolean, 
DDL properties are not really type-checked due to being handled specifically by 
PropertyDefinitions.

In particular, note that in the replication map, one of the value ('class') is 
a string while the other ('replication_factor') is an int, which is impossible 
in a DML. On that part, to be consistent, we'd need to force replication_factor 
to be a string, and I'm not sure that's a good idea because that would be 
uglier and more importantly would break too many people imho.

Of course, It's still possible to type-check property values more thoroughly 
(while letting map values not all be of the same type) but we would still not 
have full consistency between DDL and DML on that front.

It's also not a one-liner fix: it requires to refactor PropertyDefinitions, 
CFPropDefs and KSPropDefs relatively heavily (not that those classes are huge 
but still).

And there's the backward compatibility issue.

Overall, If we had released CQL3 a week ago, I'd said sure, let's clean it up. 
But with CQL3 being almost a year old, I'm leaning towards just leaving it the 
way it is.

Other opinions?

> Boolean constants syntax is not consistent between DDL and DML in CQL
> ---------------------------------------------------------------------
>
>                 Key: CASSANDRA-6120
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6120
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Michaël Figuière
>            Assignee: Sylvain Lebresne
>            Priority: Trivial
>
> DDL statements allow boolean constants to be either quoted or unquoted as:
> {code}
> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': 1} AND durable_writes = true;
> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': 1} AND durable_writes = 'true';
> {code}
> While DML statements only allow unquoted boolean constants.
> While this is not a big deal, it can introduce a bit of confusion for the 
> users. Fixing this lack of syntax consistency would break the existing 
> scripts, so that's something we might want to consider next time we'll 
> introduce some breaking changes in CQL...



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to