[
https://issues.apache.org/jira/browse/CASSANDRA-11935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310803#comment-15310803
]
Sylvain Lebresne commented on CASSANDRA-11935:
----------------------------------------------
I don't believe in doing something for CQL because SQL does it and in
particular, SQL allows pretty complicated query that we will never allow in CQL
and don't want, which imply some things are less justified in CQL. We also tend
to favor explicitness in C*/CQL. Overall, I'm not entirely that such implicit
conversions
and that justify some differences. We can certainly draw inspiration from SQL
when it make sense, but stuffs needs to be justified *for* CQL. Among other
things, we tend to favor explicitness in C*/CQL over saving a few character in
typing, and I happen to think it's a good idea. Also, the fact we've recently
added specific *explicit* syntax for such conversion (CASSANDRA-10310) and are
now saying some of it should be implicit make me worry that we're adding stuff
to the type system without a good idea of the big picture, and that worries me.
Overall, I'm not convinced that _in CQL_ there will so many case where such
implicit conversion will be necessary to justify adding their magic, but at the
very least, I'm pretty sure we can go far enough with operators without it and
so discussing their addition should be left to another ticket (besides, such
implicit conversions are not really specific to operators).
> Add support for arithmetic operators
> ------------------------------------
>
> Key: CASSANDRA-11935
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11935
> Project: Cassandra
> Issue Type: Sub-task
> Components: CQL
> Reporter: Benjamin Lerer
> Assignee: Benjamin Lerer
> Fix For: 3.x
>
>
> The goal of this ticket is to add support for arithmetic operators:
> * {{-}}: Change the sign of the argument
> * {{+}}: Addition operator
> * {{-}}: Minus operator
> * {{*}}: Multiplication operator
> * {{/}}: Division operator
> * {{%}}: Modulo operator
> This ticket we should focus on adding operator only for numeric types to keep
> the scope as small as possible. Dates and string operations will be adressed
> in follow up tickets.
> The operation precedence should be:
> # {{*}}, {{/}}, {{%}}
> # {{+}}, {{-}}
> Some implicit data conversion should be performed when operations are
> performed on different types (e.g. double + int).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)