morningman commented on a change in pull request #4678: URL: https://github.com/apache/incubator-doris/pull/4678#discussion_r499198500
########## File path: fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java ########## @@ -63,13 +62,14 @@ public void init(Analyzer analyzer) throws UserException { @Override public void computeStats(Analyzer analyzer) { super.computeStats(analyzer); - if (getChild(0).cardinality == -1) { - cardinality = -1; + long cardinality = getChild(0).cardinality; + double selectivity = computeSelectivity(); + if (cardinality < 0 || selectivity < 0) { + this.cardinality = -1; } else { - cardinality = Math.round(((double) getChild(0).cardinality) * computeSelectivity()); - Preconditions.checkState(cardinality >= 0); + this.cardinality = Math.round(cardinality * selectivity); } - LOG.info("stats Select: cardinality=" + Long.toString(cardinality)); + LOG.info("stats Select: cardinality={}", this.cardinality); Review comment: ```suggestion LOG.debug("stats Select: cardinality={}", this.cardinality); ``` ---------------------------------------------------------------- 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: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org