mychaow commented on a change in pull request #2571:
URL: https://github.com/apache/iotdb/pull/2571#discussion_r563575997
##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -668,6 +666,23 @@ private TSExecuteStatementResp
internalExecuteQueryStatement(String statement, l
}
}
+ /*
+ calculate fetch size for group by time plan
+ */
+ private int getFetchSizeForGroupByTimePlan(GroupByTimePlan groupByTimePlan) {
+ int rows = (int) ((groupByTimePlan.getEndTime() -
groupByTimePlan.getStartTime()) / groupByTimePlan
+ .getInterval());
+ // edge case for group by months when starttime is in February
+ // ie. time range = [2020-02-02, 2020-03-02), interval = 1mo, rows will
get 0
+ if (rows == 0 && groupByTimePlan.isIntervalByMonth()) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTimeInMillis(groupByTimePlan.getStartTime());
+ calendar.add(Calendar.MONTH, (int) (groupByTimePlan.getInterval() /
MS_TO_MONTH));
+ rows = calendar.getTimeInMillis() <= groupByTimePlan.getEndTime() ? 1 :
0;
Review comment:
we do not include the endTime, so it's not right to use <= here,
change it to <
----------------------------------------------------------------
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]