Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15250 )
Change subject: IMPALA-6689: Speed up point lookup for Kudu primary key ...................................................................... Patch Set 2: (2 comments) http://gerrit.cloudera.org:8080/#/c/15250/2/fe/src/main/java/org/apache/impala/planner/KuduScanNode.java File fe/src/main/java/org/apache/impala/planner/KuduScanNode.java: http://gerrit.cloudera.org:8080/#/c/15250/2/fe/src/main/java/org/apache/impala/planner/KuduScanNode.java@288 PS2, Line 288: if (isPointLookupQuery_) { : inputCardinality_ = cardinality_ = 1; : } else { > This looks correct with the exception of the case when the cardinality is 0 Limit 0 is a common trick for determining the schema of a query without executing it, e.g. https://sisu.ai/blog/lightning-fast-schema-inference-in-redshift (the author actually is a Kudu committer :)). The impala planner rewrites limit 0 queries to an empty plan in a lot of cases though anyway. I know of drivers that actually issue a lot of these queries to Impala. http://gerrit.cloudera.org:8080/#/c/15250/2/fe/src/main/java/org/apache/impala/planner/KuduScanNode.java@395 PS2, Line 395: primaryKeyColInEquivalPred++; This is assuming that we don't have duplicate equality predicates assigned to the scan. I think this is true as a consequence of how predicate assignment works in impala. but it would be good to document the assumption in the comment on line 381. You can verify by writing queries with duplicated predicates, e.g. explain select * from tpch_kudu.orders where o_orderkey = 1 and o_orderkey = 1 I think the place where there would potentially be bugs in this is if there were more complex queries with non-trivially redundant predicates that turn out to be equivalent, but I'm not aware of anything like this. -- To view, visit http://gerrit.cloudera.org:8080/15250 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4631cd4d1a528a1152b5cdcb268426f2ba1a0c08 Gerrit-Change-Number: 15250 Gerrit-PatchSet: 2 Gerrit-Owner: Wenzhe Zhou <[email protected]> Gerrit-Reviewer: Anurag Mantripragada <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Wenzhe Zhou <[email protected]> Gerrit-Comment-Date: Fri, 21 Feb 2020 00:12:25 +0000 Gerrit-HasComments: Yes
