[
https://issues.apache.org/jira/browse/CALCITE-2695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jesus Camacho Rodriguez resolved CALCITE-2695.
----------------------------------------------
Resolution: Fixed
Fixed in
[439ca73|http://git-wip-us.apache.org/repos/asf/calcite/commit/439ca73]. Thanks
[~kgyrtkirk]
> Simplify casts which are only widening nullability
> --------------------------------------------------
>
> Key: CALCITE-2695
> URL: https://issues.apache.org/jira/browse/CALCITE-2695
> Project: Calcite
> Issue Type: Improvement
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
>
> There are cases in which casts are added; but they are not neccessary.
> {code}
> @Test public void testSimplifyRedundantCast() {
> RexNode expr = cast(isTrue(vBoolNotNull()), tBoolean(true));
> assertThat(expr.getType().isNullable(), is(true));
> RexNode result = simplify.simplifyUnknownAs(expr, RexUnknownAs.UNKNOWN);
> assertThat(result.getType().isNullable(), is(false));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)