[
https://issues.apache.org/jira/browse/FLINK-5524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Timo Walther resolved FLINK-5524.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.3.0
Fixed in 1.3.0: f6c9b32c1f1fd7521e2dbe16ab20985a45d7cb07
> Support early out for code generated conjunctive conditions
> -----------------------------------------------------------
>
> Key: FLINK-5524
> URL: https://issues.apache.org/jira/browse/FLINK-5524
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Affects Versions: 1.2.0, 1.1.4, 1.3.0
> Reporter: Fabian Hueske
> Assignee: Kurt Young
> Fix For: 1.3.0
>
>
> Currently, all nested conditions for a conjunctive predicate are evaluated
> before the conjunction is checked.
> A condition like {{(v1 == v2) && (v3 < 5)}} would be compiled into
> {code}
> boolean res1;
> if (v1 == v2) {
> res1 = true;
> } else {
> res1 = false;
> }
> boolean res2;
> if (v3 < 5) {
> res2 = true;
> } else {
> res2 = false;
> }
> boolean res3;
> if (res1 && res2) {
> res3 = true;
> } else {
> res3 = false;
> }
> if (res3) {
> // emit something
> }
> {code}
> It would be better to leave the generated code as early as possible, e.g.,
> with a {{return}} instead of {{res1 = false}}. The code generator needs a bit
> of context information for that.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)