maheshk114 commented on a change in pull request #1147: URL: https://github.com/apache/hive/pull/1147#discussion_r460001925
########## File path: ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java ########## @@ -2606,6 +2607,17 @@ private long computeFinalRowCount(List<Long> rowCountParents, long interimRowCou // max # of rows = rows from left side result = Math.min(rowCountParents.get(joinCond.getLeft()), result); break; + case JoinDesc.ANTI_JOIN: + long leftRowCount = rowCountParents.get(joinCond.getLeft()); + if (leftRowCount < result) { + // Ideally the inner join count should be less than the left row count. but if its not calculated + // properly then we can assume whole of left table will be selected. + result = leftRowCount; Review comment: This case will come if the stats are not proper. So to be on safer side, i assume that all rows from the left side will be projected. That is the max value. If set it to 0, it should not trigger some re-write, assuming the join result is empty. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org