konstantinb commented on code in PR #6505:
URL: https://github.com/apache/hive/pull/6505#discussion_r4554858259
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java:
##########
@@ -1381,6 +1388,17 @@ private long evaluateChildExpr(Statistics stats,
ExprNodeDesc child,
return numRows / 2;
}
+ private static long rowsAfterEqualityFilter(long numRows, long dvs,
boolean nullSafeEqualsNull) {
+ if (dvs < 0) {
+ return numRows / 2;
+ }
+ if (dvs == 0) {
+ // no non-null values: only col <=> NULL can match, and then every row
does
Review Comment:
> Could you explain this? What does `<=>` mean? "not equals"? If that's the
case I would prefer using `!=`.
`<=>` is Hive's null-safe equality operator (`IS NOT DISTINCT FROM`), not
inequality; I've clarified the comment while retaining the SQL notation. This
branch addresses [Copilot's earlier
finding](https://github.com/apache/hive/pull/6505#discussion_r4461508365): with
a verified-zero NDV, every row is NULL, so `col <=> NULL` must keep every row.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]