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 06:23:47 UTC

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

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



##########
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:
       yes. if you set interval = 0, it will throw exception: "Interval must more than 0"




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