mirror of
https://github.com/apache/impala.git
synced 2025-12-30 03:01:44 -05:00
This patch takes advantage of a recent change in Kudu (KUDU-16) that exposes the ability to set limits on KuduScanners. Since each KuduScanner corresponds to a scan token, and there will be multiple scan tokens per query, this is just a performance optimization in cases where the limit is smaller than the number of rows per token, and Impala still needs to apply the limit on our side for cases where the limit is greater than the number of rows per token. Testing: - Added e2e tests for various situations where limits are applied at a Kudu scan node. - For the query 'select * from tpch_kudu.lineitem limit 1', a best case perf scenario for this change where the limit is highly effective, the time spent in the Kudu scan node was reduced from 6.107ms to 3.498ms (avg over 3 runs). - For the query 'select count(*) from (select * from tpch_kudu.lineitem limit 1000000) v', a worst case perf scenario for this change where the limit is ineffective, the time spent in the Kudu scan node was essentially unchanged, 32.815ms previously vs. 29.532ms (avg over 3 runs). Change-Id: Ibe35e70065d8706b575e24fe20902cd405b49941 Reviewed-on: http://gerrit.cloudera.org:8080/10119 Reviewed-by: Thomas Tauber-Marshall <tmarshall@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>