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

Open Beginner friendly
#4,096 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ehddnr301 is already working on this.

Since Oct 12, 2026.

  • #4097 by @ehddnr301 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api, backend

Research direction

Start at the REST catalog pagination code for list_tables, list_views, and list_namespaces, then inspect the SigV4 adapter’s query parsing. Send an empty pageToken on the first request when rest-page-size is set, and preserve blank query values in the adapter. Verify that the request includes pageToken= and that pagination works with a page size of 1.

Written by the indexing model from the issue text.

Description

kind:bug
Apache Iceberg version

0.12.0 (latest release)

Please describe the bug 🐞

When rest-page-size is set, list_tables, list_views and list_namespaces send pageSize without pageToken on the first request:

GET /v1/namespaces/ns/tables?pageSize=100

The REST spec says servers must return all results in one response when pageToken is not set, and that clients start pagination by sending an empty pageToken (PageToken). So compliant servers ignore rest-page-size, and some servers fail on the request. With tabulario/iceberg-rest:1.6.0 and namespaces a, b, c:

RestCatalog("t", uri=uri).list_namespaces()
# [('a',), ('b',), ('c',)]

RestCatalog("t", uri=uri, **{"rest-page-size": "1"}).list_namespaces()
# ServerError: NumberFormatException: Cannot parse null string
GET /v1/namespaces?pageSize=1             -> 500 NumberFormatException
GET /v1/namespaces?pageSize=1&pageToken=  -> {"namespaces": [["a"]], "next-page-token": "1"}

The first request should include pageToken= when rest-page-size is set. The Java client always sends pageToken, starting with an empty value. The SigV4 adapter also needs to keep blank query values, since parse_qsl drops them by default.

rest-page-size was added in #3377. The same error in apache/iceberg-rest-fixture was reported in apache/iceberg#13119.

Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
Dominant language
Python
Stars
1.2k
Forks
664
Avg merge
2d 10h
Merged PRs (30d)
131

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-python

All issues in apache/iceberg-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.