You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/10/04 02:21:30 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #4678: [Bug] Fix hard cardinality check which makes queries fail

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org