Skip to content

REST: Send empty first-page pageToken when rest-page-size is set - #4097

Open
ehddnr301 wants to merge 1 commit into
apache:mainfrom
ehddnr301:rest-empty-first-page-token
Open

ehddnr301 wants to merge 1 commit into
apache:mainfrom
ehddnr301:rest-empty-first-page-token

Conversation

@ehddnr301

Copy link
Copy Markdown

Closes #4096

Rationale for this change

When rest-page-size is set, the first list request sends pageSize without pageToken. Per the REST spec, servers return all results in one response when pageToken is not set, so the page size is ignored, and some servers (e.g. tabulario/iceberg-rest:1.6.0) fail on the request.

list_tables, list_views and list_namespaces now send an empty pageToken on the first request when rest-page-size is set:

before: ?pageSize=100
after:  ?pageSize=100&pageToken=

Requests without rest-page-size are unchanged. The SigV4 adapter now passes keep_blank_values=True to parse_qsl, so the signed query includes pageToken=.

Are these changes tested?

Yes. Tests in tests/catalog/test_rest.py cover the empty initial token for all three list APIs, a two-page list_tables run, and blank query values reaching the SigV4 signer.

Also tested manually against tabulario/iceberg-rest:1.6.0: list_namespaces() with rest-page-size=1 previously raised NumberFormatException and now returns all namespaces across pages.

Are there any user-facing changes?

With rest-page-size set, the first list request includes pageToken=. Without it, nothing changes.

Explicitly request pagination for configured page sizes and preserve blank query values in SigV4 signing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST: Send empty first-page pageToken when rest-page-size is set

1 participant