clintropolis commented on a change in pull request #10279:
URL: https://github.com/apache/druid/pull/10279#discussion_r473832613
##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java
##########
@@ -762,9 +756,20 @@ public TimeseriesQuery toTimeseriesQuery()
Iterables.getOnlyElement(grouping.getDimensions()).toDimensionSpec().getOutputName()
);
if (sorting != null) {
- // If there is sorting, set timeseriesLimit to given value if less
than Integer.Max_VALUE
- if (sorting.isLimited()) {
- timeseriesLimit = Ints.checkedCast(sorting.getLimit());
+ if (sorting.getOffsetLimit().hasOffset()) {
+ // Timeseries cannot handle offsets.
+ return null;
+ }
+
+ if (sorting.getOffsetLimit().hasLimit()) {
+ final long limit = sorting.getOffsetLimit().getLimit();
+
+ if (limit == 0) {
Review comment:
Would it be worth pushing a method into `OffsetLimit` to check that
limit is greater than 0 to use for timeseries/group by/scan to use instead of
`hasLimit`?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]