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

Julian Hyde commented on CALCITE-3987:
--------------------------------------

We could support this in a particular mode (driven by conformance or function 
library) but not in the default mode, because adding/subtracting numerics to 
dates is not standard SQL.

> Allow addition and subtraction operations between DATE and NUMERIC types.
> -------------------------------------------------------------------------
>
>                 Key: CALCITE-3987
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3987
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Drew Schmitt
>            Priority: Minor
>
> We should allow addition (PLUS operator) and subtraction (MINUS operator) 
> between DATE and NUMERIC types to be valid during the validation phase.
> Downstream, the result of the operation can be interpreted differently 
> depending on the dialect. For example, some dialects would interpret any 
> arithmetic with a DATE as implying adding/subtracting a number of days.
> Example query:
> CREATE TABLE foo (bar DATE);
> SELECT bar - 1 FROM foo;



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to