Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19927 )
Change subject: IMPALA-11123: Reimplement ORC optimized count star ...................................................................... IMPALA-11123: Reimplement ORC optimized count star Commit 7ca20b3c94b1c9c1ddd4ed1e89f0969a0df55330 revert the original optimized count(star) for ORC scan from commit f932d78ad0a30e322d59fc39072f710f889d2135 (gerrit review http://gerrit.cloudera.org:8080/18327). The revert is necessary since the unification of count star and zero slot functions into HdfsColumnarScanner and causing significant regression for non-optimized counts star query in parquet format (over 15% slower MaterializeTupleTime). This patch reimplements optimized count(star) for ORC scan code path while minimizing the code changes needed for parquet scan code path. After this patch, ORC and parquet code path will have only the following new things in common: - THdfsScanNode.count_star_slot_offset renamed to THdfsScanNode.star_slot_offset - HdfsScanner::IssueFooterRanges will only issue footer ranges if IsZeroSlotTableScan() or optimize_count_star() is true (made possible for parquet by IMPALA-12631). The structure of HdfsParquetScanner::GetNextInternal() remains unchanged. Its zero scan slot code path is still served through num_rows metadata from the parquet footer, while the optimized count star code path still loops over row groups metadata (also from parquet footer). The following table shows single-node benchmark result of 3 count query variant on TPC-DS scale 10, both in ORC and parquet format, looped 9 times. +-----------+---------------------------+---------+--------+-------------+------------+ | Workload | Query | Format | Avg(s) | Base Avg(s) | Delta(Avg) | +-----------+---------------------------+---------+--------+-------------+------------+ | TPCDS(10) | TPCDS-Q_COUNT_UNOPTIMIZED | orc | 0.30 | 0.28 | +6.50% | | TPCDS(10) | TPCDS-Q_COUNT_OPTIMIZED | parquet | 0.14 | 0.14 | +1.56% | | TPCDS(10) | TPCDS-Q_COUNT_ZERO_SLOT | parquet | 0.27 | 0.27 | +1.42% | | TPCDS(10) | TPCDS-Q_COUNT_ZERO_SLOT | orc | 0.28 | 0.29 | -3.03% | | TPCDS(10) | TPCDS-Q_COUNT_UNOPTIMIZED | parquet | 0.21 | 0.22 | -4.45% | | TPCDS(10) | TPCDS-Q_COUNT_OPTIMIZED | orc | 0.14 | 0.21 | I -35.92% | +-----------+---------------------------+---------+--------+-------------+------------+ Testing: - Restore PlannerTest.testOrcStatsAgg - Restore TestAggregationQueriesRunOnce and TestAggregationQueriesRunOnce::test_orc_count_star_optimization - Exercise count(star) in TestOrc::test_misaligned_orc_stripes - Pass core tests Change-Id: I5971c8f278e1dee44e2a8dd4d2f043d22ebf5d17 Reviewed-on: http://gerrit.cloudera.org:8080/19927 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M be/src/exec/hdfs-scan-node-base.cc M be/src/exec/hdfs-scan-node-base.h M be/src/exec/hdfs-scanner.cc M be/src/exec/orc/hdfs-orc-scanner.cc M be/src/exec/orc/hdfs-orc-scanner.h M be/src/exec/parquet/hdfs-parquet-scanner.cc M be/src/exec/parquet/hdfs-parquet-scanner.h M common/thrift/PlanNodes.thrift M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java M fe/src/test/java/org/apache/impala/planner/PlannerTest.java A testdata/workloads/functional-planner/queries/PlannerTest/orc-stats-agg.test A testdata/workloads/functional-query/queries/QueryTest/orc-stats-agg.test M testdata/workloads/functional-query/queries/QueryTest/partition-key-scans.test M testdata/workloads/functional-query/queries/QueryTest/scanners.test M tests/query_test/test_aggregation.py M tests/query_test/test_scanners.py M tests/util/test_file_parser.py 17 files changed, 809 insertions(+), 98 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/19927 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5971c8f278e1dee44e2a8dd4d2f043d22ebf5d17 Gerrit-Change-Number: 19927 Gerrit-PatchSet: 8 Gerrit-Owner: Riza Suminto <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: David Rorke <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Reviewer: Zihao Ye <[email protected]>
