clintropolis commented on a change in pull request #10279:
URL: https://github.com/apache/druid/pull/10279#discussion_r473853234
##########
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:
Ah i wasn't thinking it through, I guess you still need to check
`hasLimit` for the non-zero case.
For timeseries though, it looks like `timeseriesLimit` is initialized to 0,
is returning null here changing behavior? I guess a zero here is an explicit
zero, meaning unlimited wasn't probably the expected response?
----------------------------------------------------------------
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]