[
https://issues.apache.org/jira/browse/CALCITE-3746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036247#comment-17036247
]
Chunwei Lei commented on CALCITE-3746:
--------------------------------------
I know what you mean. But that test case shows how udf may be used in
production. Many system might does not have such annotation to indicate what
the udf's behavior is when meeting NULL. Besides that, another disadvantage is
that it might bring extra overhead if we change the order. For instance, for
{{a is not null and heavey_udf(a)!='1'}} , if we retain the order, we do not
have to execute {{heavy_udf(a)}} if a is NULL.
> RexSimplify changes the order of IS NOT NULL in And RexNode
> -----------------------------------------------------------
>
> Key: CALCITE-3746
> URL: https://issues.apache.org/jira/browse/CALCITE-3746
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.20.0
> Reporter: pengzhiwei
> Assignee: Chunwei Lei
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The RexSimplify changes the order of IS NOT NULL in And RexNode.The following
> expression
> {code:java}
> a is not null and length(a) > 0{code}
> is optimazted to
> {code:java}
> length(a) > 0 and a is not null{code}
> which will affect the logic short circuit for null-test.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)