eric-maynard opened a new pull request, #273:
URL: https://github.com/apache/polaris/pull/273

   # Description
   
   The Apache Iceberg REST catalog spec 
[describes](https://github.com/apache/iceberg/blob/f7c6d57a03282516c6f988fa23a809416cd765b1/open-api/rest-catalog-open-api.yaml#L258)
 how APIs like `listNamespaces` can implement pagination, but Polaris currently 
does not implement pagination.
   
   This PR implements pagination for `listNamespaces` and `listTables` and 
introduces a framework that could be used to implement pagination for other 
APIs like `listCatalogs`.
   
   Fixes #147 
   
   ## Type of change
   
   Please delete options that are not relevant.
   
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Documentation update
   - [x] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to not work as expected)
   - [ ] This change requires a documentation update
   
   # How Has This Been Tested?
   
   Testing confirms that the `page-size` limit applies, and that page tokens 
can be used to continue a listing operation:
   ```
     curl -X GET 
"http://localhost:8181/api/catalog/v1/quickstart_catalog/namespaces"; \
        -H "Authorization: Bearer principal:root;realm:default-realm" \
        -H "Content-Type: application/json" \
        && echo
   {"namespaces":[["ns1"],["ns2"],["ns3"]],"next-page-token":null}
   
   . . .
   
   curl -X GET 
"http://localhost:8181/api/catalog/v1/quickstart_catalog/namespaces"; \
        -H "Authorization: Bearer principal:root;realm:default-realm" \
        -H "Content-Type: application/json" \
        --get \
        --data "pageSize=1" \
        && echo
   {"namespaces":[["ns1"]],"next-page-token":"cG9sYXJpczoxOjE="}
   
   . . .
   
   curl -X GET 
"http://localhost:8181/api/catalog/v1/quickstart_catalog/namespaces"; \
        -H "Authorization: Bearer principal:root;realm:default-realm" \
        -H "Content-Type: application/json" \
        --get \
        --data "pageToken=cG9sYXJpczoxOjE=" \
        --data "pageSize=1" \
        && echo
   {"namespaces":[["ns2"]],"next-page-token":"cG9sYXJpczoyOjE="}
   ```
   
   # Checklist:
   
   Please delete options that are not relevant.
   
   - [ ] I have performed a self-review of my code
   - [ ] I have commented my code, particularly in hard-to-understand areas
   - [ ] I have made corresponding changes to the documentation
   - [ ] My changes generate no new warnings
   - [ ] If adding new functionality, I have discussed my implementation with 
the community using the linked GitHub issue
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to