apache / drill

Apache Drill is a distributed MPP query layer for self describing data
https://drill.apache.org/
Apache License 2.0
1.93k stars 979 forks source link

storage-http: pagination with next url extracted from the page? #2828

Open matteoredaelli opened 1 year ago

matteoredaelli commented 1 year ago

Hello

Qliksaas apis use pagination without offset params. They provide the "next" url in the response page

How could I tell drill to use "links.next.href" value for retreiving further records?

https://qlik.dev/apis/pagination-sorting-filtering

{
  "data": ["list", "of", "items"],
  "links": {
    "prev": { "href": null },
    "next": { "href": "https://example.org/api/v1/items?page=<next-cursor>" },
  }
}
cgivre commented 1 year ago

Take a look here: https://github.com/apache/drill/blob/master/contrib/storage-http/Pagination.md. Drill might already do what you need to do.

matteoredaelli commented 1 year ago

Thanks, you are right. It is in the section "Index / KeySet Pagination" : I need to add "nextPageParam" parameter but it is not clear which "method" I should set for "Index / KeySet Pagination" (it is indicated for the others options). I think "INDEX" as I see in teh code

  public enum PaginatorMethod {
    OFFSET,
    PAGE,
    INDEX,
    HEADER_INDEX
  }

Thanks Matteo