Hello Peter Rozsa, Nandor Kollar, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24733
to look at the new patch set (#4).
Change subject: IMPALA-14996: Optimize count(*) for Iceberg V3 DV-only tables
......................................................................
IMPALA-14996: Optimize count(*) for Iceberg V3 DV-only tables
Enable compile-time count(*) optimization for Iceberg V3 tables
whose only delete files are Deletion Vectors (DVs). As for V1
tables, plain count(*) is rewritten to a constant:
live rows = total data records - rows deleted by DVs
For the current snapshot, the deleted row count is the sum of
record counts of non-dangling DVs. IcebergContentFileStore
accumulates it while the DVs are added to the store, so it costs
nothing per query. The snapshot summary's total-position-deletes
is not used here because it can include dangling deletes. For
time travel queries, the snapshot summary value is still used.
Key changes:
- SelectStmt and Calcite's IcebergCountStarOptimizer check
hasDeleteFiles() before hasOnlyDeletionVectors(), because the
latter needs a manifest scan for time travel queries. V1 and
DV-only tables share the constant rewrite
(optimizePlainCountStarQueryConstant /
transformForConstantCountStarOptimization).
- Renamed transformForV1CountStarOptimization to
transformForConstantCountStarOptimization in
IcebergCountStarOptimizer.
- Added FeIcebergTable.Utils.hasOnlyDeletionVectors(),
getRecordCountForDvOnlyTable() and getTotalPositionDeletes().
Testing:
- Added CALCITE_PLANNER_RUNTIME_PROFILE checks to verify
compile-time optimization (NumRowGroups: 0)
- Extended iceberg-v3-plain-count-star-optimization.test with
runtime profile checks for the constant rewrite, mixed
aggregates, and a partitioned DV table queried with and without
partition filters.
- Verified both native and Calcite planners produce expected
runtime profiles
Change-Id: I0e6239629ee779a64808a0a4bbe041ef756c5bb2
Assited-by: Composer 2.5 (Cursor)
---
M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
M fe/src/main/java/org/apache/impala/catalog/FeIcebergTable.java
M fe/src/main/java/org/apache/impala/catalog/IcebergContentFileStore.java
M fe/src/main/java/org/apache/impala/rewrite/CountStarToConstRule.java
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/IcebergCountStarOptimizer.java
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteIcebergTable.java
M
testdata/workloads/functional-query/queries/QueryTest/iceberg-v3-plain-count-star-optimization.test
7 files changed, 224 insertions(+), 32 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/33/24733/4
--
To view, visit http://gerrit.cloudera.org:8080/24733
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e6239629ee779a64808a0a4bbe041ef756c5bb2
Gerrit-Change-Number: 24733
Gerrit-PatchSet: 4
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>