Search code examples
apache-phoenixsquirrel-sql

Using limit and offset in phoenix query


I am trying to get 10 records from a merged table, after skipping the first 10 records. I execute the following query in Phoenix(using SQuirreL SQL Client Version 3.7.1) as we do in MySQL:

select /*+USE_SORT_MERGE_JOIN*/ * from "ds_jatin", "ds_prabhjot" where "ds_jatin"."id" = "ds_prabhjot"."id" LIMIT 10 OFFSET 10

But I get the following error:

Error: ERROR 602 (42P00): Syntax error. Missing "EOF" at line 1, column 94. SQLState: 42P00 ErrorCode: 602

If I remove the OFFSET 10 towards the end of the query, I get the result, but obviously the first 10 rows. How do I get the next 10 rows through Phoenix Query?


Solution

  • Use the latest version of Phoenix,

    Version 4.8.0 has Offset Support for Paged Queries

    Release Note - http://mail-archives.us.apache.org/mod_mbox/www-announce/201608.mbox/%3CCANDVwqicP_WfEq4YRmmhW54KdOHJpB+h8nj_teWLks6pQYiquQ@mail.gmail.com%3E

    Please Refer to https://phoenix.apache.org/paged.html