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

Ruben Q L commented on CALCITE-7746:
------------------------------------

Probably in RexSimplify's {{private boolean isSafe(RexCall call, boolean 
deep)}} we should add a new special treatment block {{if 
(SqlKind.BINARY_ARITHMETIC.contains(sqlKind) && 
call.operands.stream().anyMatch(o -> o.getType() instanceof IntervalSqlType))}} 
with a similar handling as it happens already with CHECKED_ARITHMETIC

> Review operation safety on arithmetic on dates and intervals
> ------------------------------------------------------------
>
>                 Key: CALCITE-7746
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7746
>             Project: Calcite
>          Issue Type: Task
>          Components: core
>            Reporter: Ruben Q L
>            Priority: Major
>
> Currently, arithmetic operations on dates and intervals do not have any 
> particular management (they are treated as any other operands).
> However, in this case arithmetic operations (even the standard, non-checked 
> ones) can throw at runtime, so they should probably be reviewed and not 
> considered "safe" in RexSimply.



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

Reply via email to