Details
Description
As per documentation (https://phoenix.apache.org/paged.html)
SELECT * FROM FOO LIMIT 10 OFFSET 10
returns rows 11 to 20.
However when adding ORDER BY:
SELECT * FROM FOO ORDER BY BAR LIMIT 10 OFFSET 10
it returns nothing. Only raising the LIMIT with the appropriate OFFSET i.e.
SELECT * FROM FOO ORDER BY BAR LIMIT 20 OFFSET 10
will now return rows 11 to 20
while
SELECT * FROM FOO LIMIT 20 OFFSET 10
returns rows 11 to 30
In short: LIMIT + OFFSET in combo with ORDER BY on non primary key has unexpected returns.
Attachments
Issue Links
- is duplicated by
-
PHOENIX-3342 ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
- Resolved