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

Dmitry Sysolyatin commented on CALCITE-7360:
--------------------------------------------

Right, it depends on the database. We have the same issue with functions. Some 
functions can return different results depending on the database, especially 
when working with NULL values.

So, ideally, unsigned negation should also be database-specific. That is what 
you suggested about using another SqlOperator, so it’s good that we have this 
option. It can be done later, when someone actually needs it.

??Note that this is not really a problem of syntax, but of type checking. In 
principle you can use another SqlOperator for unary negation which has 
different rules (except the fact that Calcite does not make it easy to replace 
the standard operator table)??



> The meaning of negation for unsigned numbers is not defined
> -----------------------------------------------------------
>
>                 Key: CALCITE-7360
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7360
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>              Labels: pull-request-available
>
> Some time ago unsigned integer types were introduced in Calcite.
> They allow all arithmetic operations as signed types.
> However, the meaning of negation is not defined. Using negation in a quidem 
> test causes an exception, since the implementation is incorrect.
> Questions:
>  * Should negation be allowed at all?
>  * Should it coerce the value to a larger integer type? 
>  * Or should it work as in C?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to