cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11935) Add support for arithmetic operators
Date Wed, 01 Jun 2016 16:31:59 GMT

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

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

{quote}
Also, I actually don't think we should allow 'double + int' at all: we're a database where
the size of things matter and we shouldn't be implicit in changing the size of what we deal
with.
{quote}

I checked ([Oracle|https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements002.htm#g195937],
[SQLServer|https://msdn.microsoft.com/en-us/library/ms191530.aspx] and [MySQL|http://dev.mysql.com/doc/refman/5.7/en/type-conversion.html])
and they all provide implicite data conversion to allow things like 'double + int'. It is
not about changing the size of data on disk, it is more about facilitating the users life
by providing them some way to transform their data in what they need easily. I think that
there is a lot of cases where you might want to perform some operations between 2 differents
numeric types.

> 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)

Mime
View raw message