soumyakanti3578 commented on a change in pull request #2514:
URL: https://github.com/apache/hive/pull/2514#discussion_r676864675
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/HiveRelMdDistinctRowCount.java
##########
@@ -93,6 +89,16 @@ public Double getDistinctRowCount(HiveJoin rel,
RelMetadataQuery mq, ImmutableBi
groupKey, predicate, true);
}
+ public Double getDistinctRowCount(RelNode r, RelMetadataQuery mq,
ImmutableBitSet groupKey,
+ RexNode predicate) {
+ if (r instanceof SingleRel) {
+ return mq.getDistinctRowCount(r.getInput(0), groupKey, predicate);
+ } else if (r instanceof JdbcHiveTableScan) {
+ return getDistinctRowCount(((JdbcHiveTableScan) r).getHiveTableScan(),
mq, groupKey, predicate);
+ }
+
+ return super.getDistinctRowCount(r, mq, groupKey, predicate);
+ }
Review comment:
Added a comment in the method with a brief explanation. Changed
`SingleRel` to `Converter`, and added a method for
`getDistictRowCount(JdbcHiveTableScan...)`.
--
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]