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

Drew Schmitt commented on CALCITE-3987:
---------------------------------------

Teradata supports this syntax.

> 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