Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Tried a simple example over a collection containing 11 docs with id's (1-11)
SELECT id FROM $ALIAS ORDER BY id DESC OFFSET 5 FETCH NEXT 5 ROWS ONLY
Got back the first page (11,10,9,8,7) vs. the second (6,5,4,3,2), i.e. it's just doing LIMIT 5 with offset 0 vs. respecting the FETCH with OFFSET.
From the Calcite grammar:
[ ORDER BY orderItem [, orderItem ]* ] [ LIMIT [ start, ] { count | ALL } ] [ OFFSET start { ROW | ROWS } ] [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]