You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/11/17 04:22:11 UTC

[GitHub] [iotdb] neuyilan commented on a change in pull request #2060: division by zero bug

neuyilan commented on a change in pull request #2060:
URL: https://github.com/apache/iotdb/pull/2060#discussion_r524875355



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
##########
@@ -687,8 +687,10 @@ private void deduplicate(QueryPlan queryPlan, int fetchSize)
     if (queryPlan instanceof GroupByTimePlan) {
       GroupByTimePlan plan = (GroupByTimePlan) queryPlan;
       // the actual row number of group by query should be calculated from startTime, endTime and interval.
-      fetchSize = Math
-          .min((int) ((plan.getEndTime() - plan.getStartTime()) / plan.getInterval()), fetchSize);
+      long interval = (plan.getEndTime() - plan.getStartTime()) / plan.getInterval();

Review comment:
       What about the plan.getInterval() is zero?  does the code has been checked before?




----------------------------------------------------------------
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