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:

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
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
pageSizethen you have to also passpageTokeneven for the initial request, otherwise you get an exception that it failed to parse an integer.The exception stack looks like the following:
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)whereINITIAL_PAGE_TOKENis an empty string. But if you don't pass apageTokenquery parameter (which you wouldn't do on the first request, you'd only use it on subsequent requests) then the check fails becausepageTokenisnull. Leading toInteger.parseInt(pageToken)throwing an exception because of the null string. The fix is likely just to add a null check there.Willingness to contribute