PDGGK opened a new pull request, #17180: URL: https://github.com/apache/iotdb/pull/17180
## Summary This PR adds support for double-closed interval `[start, end]` in GROUP BY time clause, complementing the existing half-open interval `[start, end)`. ### New Syntax ```sql -- Inclusive end time (NEW) SELECT count(s1) FROM root.test GROUP BY ([0, 100], 10ms) -- includes timestamp 100 -- Exclusive end time (existing) SELECT count(s1) FROM root.test GROUP BY ([0, 100), 10ms) -- excludes timestamp 100 ``` ## Changes | File | Description | |------|-------------| | `IoTDBSqlParser.g4` | Add grammar rule for `]` right bracket | | `GroupByTimeComponent.java` | Add `rightClosed` field | | `GroupByTimeParameter.java` | Add serialization support for `rightClosed` | | `ASTVisitor.java` | Parse right bracket type | | `AggregationUtil.java` | Pass `rightClosed` to factory | | `TimeRangeIteratorFactory.java` | Update signature (9 args) | | `AggrWindowIterator.java` | Override `getFinalTimeRange()` for inclusive end | | `PreAggrWindowIterator.java` | Override `getFinalTimeRange()` for inclusive end | | `PreAggrWindowWithNaturalMonthIterator.java` | Constructor update | | `GroupByTimeExpression.java` | Add fields and serialization | | `ExpressionFactory.java` | Normalize `[start, end]` to `[start, end+1)` | | `TimeRangeIteratorTest.java` | Fix test signatures for new factory | ## Test Plan - [x] Unit tests pass (`TimeRangeIteratorTest` - 4 tests) - [x] Code formatting verified (`mvn spotless:check`) - [ ] Integration tests (to be added if needed) ## Compatibility This is a **backward-compatible** change. The existing `[start, end)` syntax continues to work as before. The new `[start, end]` syntax is opt-in. Fixes #17108 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
