amansinha100 commented on a change in pull request #1718: DRILL-7121: Use
correct ndv when statistics is disabled
URL: https://github.com/apache/drill/pull/1718#discussion_r270055924
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdDistinctRowCount.java
##########
@@ -75,8 +75,25 @@ public Double getDistinctRowCount(Join rel,
RelMetadataQuery mq,
@Override
public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq,
ImmutableBitSet groupKey, RexNode predicate) {
- if (rel instanceof TableScan && !DrillRelOptUtil.guessRows(rel)) {
- return getDistinctRowCount((TableScan) rel, mq, groupKey, predicate);
+ if (rel instanceof DrillScanRelBase) {
+ DrillTable table = rel.getTable().unwrap(DrillTable.class);
+ if (table == null) {
+ if (rel.getTable().unwrap(DrillTranslatableTable.class) != null) {
Review comment:
This code block seems to be used in multiple places .. why not make it a
utility method ?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services