Skip to content

REST Catalog fixture is particular about query params #13119

Description

@zeroshade

Apache Iceberg version

1.9.0 (latest release)

Query engine

None

Please describe the bug 🐞

I was testing the Iceberg CLI built using https://github.com/apache/iceberg-go while working on the new release along with @kevinjqliu and we discovered an issue in the iceberg-rest-fixture. It turns out that if you set a pageSize then you have to also pass pageToken even for the initial request, otherwise you get an exception that it failed to parse an integer.

The exception stack looks like the following:

Image

With a bit of digging, the issue appears to be here: https://github.com/apache/iceberg/blob/apache-iceberg-1.9.0/core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java#L114

On that line, we do INITIAL_PAGE_TOKEN.equals(pageToken) where INITIAL_PAGE_TOKEN is an empty string. But if you don't pass a pageToken query parameter (which you wouldn't do on the first request, you'd only use it on subsequent requests) then the check fails because pageToken is null. Leading to Integer.parseInt(pageToken) throwing an exception because of the null string. The fix is likely just to add a null check there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions