You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "lancelly (via GitHub)" <gi...@apache.org> on 2023/11/01 08:40:54 UTC
Re: [PR] [IOTDB-6224] Fix group by month in non-ms precision and mixed unit [iotdb]
lancelly commented on code in PR #11429:
URL: https://github.com/apache/iotdb/pull/11429#discussion_r1378526056
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/aggregation/timerangeiterator/AggrWindowIterator.java:
##########
@@ -92,24 +87,31 @@ private TimeRange getRightmostTimeRange() {
long queryRange = endTime - startTime;
long intervalNum;
- if (isSlidingStepByMonth) {
- intervalNum = (long) Math.ceil(queryRange / (double) (slidingStep * MS_TO_MONTH));
- retStartTime = DateTimeUtils.calcIntervalByMonth(startTime, intervalNum * slidingStep);
+ if (slidingStep.containsMonth()) {
+ intervalNum =
+ (long)
+ Math.ceil(
+ queryRange
+ / (double)
+ (slidingStep.getMaxTotalDuration(TimestampPrecisionUtils.currPrecision)));
Review Comment:
I am not very familiar with this part of the code, so I wonder why use getMaxTotalDuration here? Will there be a problem if 1 month has less than 31 days?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org