Qifan Chen has posted comments on this change. ( http://gerrit.cloudera.org:8080/16349 )
Change subject: IMPALA-7310: Partial fix for NDV cardinality with NULLs. ...................................................................... Patch Set 4: (1 comment) http://gerrit.cloudera.org:8080/#/c/16349/3/fe/src/main/java/org/apache/impala/analysis/SlotRef.java File fe/src/main/java/org/apache/impala/analysis/SlotRef.java: http://gerrit.cloudera.org:8080/#/c/16349/3/fe/src/main/java/org/apache/impala/analysis/SlotRef.java@96 PS3, Line 96: if (numDistinctValues_ == 0 && desc_.getIsNullable() && desc_.getStats() != null > I was thinking about that but we'd want to check the slot nullability which Yeah, desc_ is local. It sounds like ::getNumDistinctValues() can provide two kinds of estimate: one for nullable column and one for not nullable column. Thus, we can write the above code as numDistinctValues_ = desc_.getStats().getNumDistinctValues(desc_.getIsNullable()); Some of the tests here can be moved inside ::getNumDistinctValues(bool isNullable). -- To view, visit http://gerrit.cloudera.org:8080/16349 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iec967053b4991f8c67cde62adf003cbd3f429032 Gerrit-Change-Number: 16349 Gerrit-PatchSet: 4 Gerrit-Owner: Shant Hovsepian <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: David Rorke <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Qifan Chen <[email protected]> Gerrit-Reviewer: Shant Hovsepian <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Comment-Date: Tue, 25 Aug 2020 13:12:31 +0000 Gerrit-HasComments: Yes
