Fang-Yu Rao has submitted this change and it was merged. ( 
https://gerrit.cloudera.org/25110 )

Change subject: IMPALA-15545: Estimate missing number of rows for Kudu tables
......................................................................

IMPALA-15545: Estimate missing number of rows for Kudu tables

Before this patch, in CalciteTable, when a Kudu table (KuduTable or
LocalKuduTable) has no pre-computed HMS stats, table_.getNumRows()
returns -1. The constructor only populated estimatedMissingStats_ for
FeFsTable, leaving it null for Kudu tables. This caused getRowCount() to
fail when we tried to join such a Kudu table with other tables.

This fixes the issue by mirroring classic planner's Kudu fallback in
KuduScanNode: use HMS stats when available, otherwise fetch Kudu's live
row count so that getRowCount() of a Kudu table won't fail.

Testing:
 - Added a new end-to-end test to verify we fixed the issue.

Change-Id: I979be4b9333ac74b1a38ffb02c49aa981892e2b1
Assisted-by: Composer 2.5 (Cursor)
Reviewed-on: https://gerrit.cloudera.org/25110
Reviewed-by: Michael Smith <[email protected]>
Reviewed-by: Steve Carlin <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Fang-Yu Rao <[email protected]>
Tested-by: Fang-Yu Rao <[email protected]>
---
M fe/src/main/java/org/apache/impala/catalog/FeFsTable.java
M fe/src/main/java/org/apache/impala/catalog/FeKuduTable.java
M fe/src/main/java/org/apache/impala/catalog/FeTable.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteTable.java
A testdata/workloads/functional-query/queries/QueryTest/calcite_kudu_stats.test
M tests/query_test/test_calcite_planner.py
6 files changed, 154 insertions(+), 14 deletions(-)

Approvals:
  Michael Smith: Looks good to me, but someone else must approve
  Steve Carlin: Looks good to me, approved
  Impala Public Jenkins: Verified
  Fang-Yu Rao: Looks good to me, approved; Verified

--
To view, visit https://gerrit.cloudera.org/25110
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I979be4b9333ac74b1a38ffb02c49aa981892e2b1
Gerrit-Change-Number: 25110
Gerrit-PatchSet: 10
Gerrit-Owner: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>

Reply via email to