Aleksandr Efimov has posted comments on this change. ( 
https://gerrit.cloudera.org/25001 )

Change subject: IMPALA-15778: Use HBO row counts in Calcite scans
......................................................................


Patch Set 6:

(6 comments)

https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteTable.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteTable.java:

https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteTable.java@268
PS6, Line 268: "HBOStats.TotalTime"
> nit: use HistoricalStats.HBO_STATS_TOTAL_TIME instead of the string literal
Switched to `HistoricalStats.HBO_STATS_TOTAL_TIME` in PS7.


https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java
File 
java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java:

https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java@151
PS6, Line 151: QUERY
> Could you add one with a filter, e.g. "... where bigint_col = 10" with unfi
Added the filter test in PS7. With 321 rows from HBO, the equality filter 
estimates 32.1 rows.


https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java@154
PS6, Line 154:     RelNode plan = logicalPlan(true);
             :     while (!(plan instanceof TableScan)) plan = plan.getInput(0);
             :     CalciteTable table = ((TableScan) 
plan).getTable().unwrap(CalciteTable.class);
> nit: This duplicates several times. Can we extract them into a shared metho
Extracted the repeated scan lookup into `tableScan()` in PS7.


https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java@195
PS6, Line 195:       stats.setNumDistinctValues(catalogNdv);
> nit: can we add a comment for why we update an returned object and how it i
Added a comment in PS7 explaining that the estimator reads the shared catalog 
stats.


https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java@222
PS6, Line 222:   public void testUnknownHistoricalInputRows() throws 
ImpalaException {
> All tests use functional.alltypes, which has full stats. Could you add a te
Added a test on `functional_parquet.alltypestiny` with no catalog row count in 
PS7.


https://gerrit.cloudera.org/#/c/25001/6/java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteHboStats.java@299
PS6, Line 299:     String query = "select o_orderkey from tpch_parquet.orders";
> Maybe using functional_parquet.alltypes is simpler so you don't need the TP
Switched the `COUNT(*)` test to `functional_parquet.alltypes` and added the 
`TABLESAMPLE` regression in PS7.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0f530098d34869cda5ff36a06576bb4854ad7f4f
Gerrit-Change-Number: 25001
Gerrit-PatchSet: 6
Gerrit-Owner: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Thu, 26 Nov 2026 08:48:12 +0000
Gerrit-HasComments: Yes

Reply via email to