[
https://issues.apache.org/jira/browse/CALCITE-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16895877#comment-16895877
]
Zoltan Haindrich commented on CALCITE-3215:
-------------------------------------------
unfortunately no:
* division is not safe, because of division by zero at runtime; however it is
strong
* for cast; some parsing exception may occur at runtime; however it is strong,
since cast(null as x) doesn't really do anything...
I think both strong; and safe properties should be moved to the "kind" ; to
help decide to do something based on the property of the kind.
> Simplification may have not fully simplified IS NOT NULL expressions
> --------------------------------------------------------------------
>
> Key: CALCITE-3215
> URL: https://issues.apache.org/jira/browse/CALCITE-3215
> Project: Calcite
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> CALCITE-2929 have added a safety check to avoid simplifying problematic cases.
> The safety check apparently misses some kinds, for example: {{UNARY_PLUS}}
> {code}
> @Test public void testIsNullSimplificationWithUnaryPlus() {
> RexNode expr =
> isNotNull(coalesce(unaryPlus(vInt(1)), vIntNotNull(0)));
> RexNode s = simplify.simplifyUnknownAs(expr, RexUnknownAs.UNKNOWN);
> assertThat(expr.isAlwaysTrue(), is(true));
> assertThat(s, is(trueLiteral));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)