Alex Behm has posted comments on this change. Change subject: IMPALA-5003: Constant propagation in scan nodes ......................................................................
Patch Set 16: (6 comments) http://gerrit.cloudera.org:8080/#/c/6389/16/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java File fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java: Line 418: if (analyzer.getQueryCtx().client_request.getQuery_options().enable_expr_rewrites) { use analyzer.getQueryOptions() http://gerrit.cloudera.org:8080/#/c/6389/16/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java File fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java: Line 1274: if (analyzer.getQueryCtx().client_request.query_options.enable_expr_rewrites) { use analyzer.getQueryOptions() http://gerrit.cloudera.org:8080/#/c/6389/16/testdata/workloads/functional-planner/queries/PlannerTest/constant-propagation.test File testdata/workloads/functional-planner/queries/PlannerTest/constant-propagation.test: Line 159: select count(*) from There's still a question as to whether we should impose a limit on the size of the conjunct list we'll optimize (due to N^2 cost), similar to what we do in ExtractCommonConjunctsRule. I'd suggest running perf on some extreme examples to see what a reasonable cutoff might be. Or you can also adopt the ExtractCommonConjunctsRule threshold. Line 245: (coalesce(NULL, T.int_col) + random() * T.tinyint_col = 100 OR > In testing this, I discovered the following: This is the current intended behavior. See the bottom of hdfs.test planner test. The behavior is questionable, but it certainly has nothing to do with your change. Line 289: where l_partkey < l_suppkey and c.c_nationkey = 10 and o_orderkey = o_shippriority and l_suppkey = 10 and o_shippriority = c_nationkey long line Line 335: 00:SCAN HDFS [functional.alltypes] Why not an EmptySetNode? -- To view, visit http://gerrit.cloudera.org:8080/6389 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79750a8edb945effee2a519fa3b8192b77042cb4 Gerrit-PatchSet: 16 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Zach Amsden <zams...@cloudera.com> Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com> Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Marcel Kornacker <mar...@cloudera.com> Gerrit-Reviewer: Zach Amsden <zams...@cloudera.com> Gerrit-HasComments: Yes