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

Benjamin Lerer commented on CASSANDRA-11935:
--------------------------------------------

{quote}FWIW, it might be that we are OK with this imprecision, but we should at 
least consider the behaviour, and then document it clearly.{quote}

There are all sort of problems with operations (overflow, lost of precisions, 
...) and it is perfectly fine in my opinion. CQL is strongly typed and it has 
its consequences good and bad. Our logic here is rather similar to other 
databases like (Oracle, MSSQL, ...) so users should not be surprised by it.

Implementing it this way was a conscious decision.

This all discussion started with the blog post I was preparing on the subject. 
I will add a section to it to warn the users about those problems.

   

> 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
>            Priority: Major
>             Fix For: 4.0
>
>
> 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
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to