[
https://issues.apache.org/jira/browse/FLINK-22983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17363362#comment-17363362
]
Jingsong Lee commented on FLINK-22983:
--------------------------------------
Hi [~maver1ck], can you check the generated code? I think Flink SQL already
have lazy condition evaluation. Consider SQL: SELECT * FROM Table3 where a > 0
AND b > 100
The code is:
{code:java}
result$7 = false;
if (!isNull$6) {
result$7 = field$5 > ((int) 0);
}
boolean result$11 = false;
if (isNull$6 || result$7) {
isNull$9 = isNull$8;
result$10 = false;
if (!isNull$9) {
result$10 = field$8 > ((int) 100);
}
.....
}{code}
> Support lazy evaluation in Flink SQL
> ------------------------------------
>
> Key: FLINK-22983
> URL: https://issues.apache.org/jira/browse/FLINK-22983
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Runtime
> Affects Versions: 1.13.1
> Reporter: Maciej Bryński
> Priority: Major
>
> Currently when there is logical condition in Flink SQL we're calculating all
> arguments.
> Example:
> {code:java}
> SELECT n > 0 AND n > 100 {code}
> This will trigger both checks even when n > 0.
> Same for AND
> {code:java}
> SELECT n > 0 AND n > 100 {code}
> will trigger n > 100 check for n <= 0
>
> I think we should support lazy condition evaluation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)