Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/18581 )
Change subject: IMPALA-11284: Enable expression rewrites for || and Between predicate in values clause ...................................................................... Patch Set 3: (1 comment) http://gerrit.cloudera.org:8080/#/c/18581/3/testdata/workloads/functional-query/queries/QueryTest/values.test File testdata/workloads/functional-query/queries/QueryTest/values.test: http://gerrit.cloudera.org:8080/#/c/18581/3/testdata/workloads/functional-query/queries/QueryTest/values.test@149 PS3, Line 149: "hello" || "world", 0 <= 1 || 0.5 < 0.6 > Yeah looks like we are not handling this if the said operators are deeper i Looked into this a bit and realized that Impala already distinguishes between "optional" and "non-optional" rewrite rules: https://github.com/apache/impala/blob/23d09638de35dcec6419a5e30df08fd5d8b27e7d/fe/src/main/java/org/apache/impala/analysis/Analyzer.java#L556 So ExtractCompoundVerticalBarExprRule is always done, even if enable_expr_rewrites false. I think that what we actually want here is to run all "non-optional" rules in the VALUES close, but skip "optional" ones, as in case a new "non-optional" rule will be added, VALUES will need to apply them automatically. ExprRewriter could be extended to get an "non-optional" and an "optional" rule list. The rewrite() function would apply the concatenated list of "non-optional" and "optional" rules, while a rewriteNonOptional() could be added that would be called from VALUES. -- To view, visit http://gerrit.cloudera.org:8080/18581 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I99b8b33bf6468d12b9e26f0a6e744feb7072619c Gerrit-Change-Number: 18581 Gerrit-PatchSet: 3 Gerrit-Owner: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com> Gerrit-Comment-Date: Thu, 09 Jun 2022 09:46:53 +0000 Gerrit-HasComments: Yes