Skip to content

Commit 725e8f1

Browse files
committed
fix(iceberg): disable pagination on catalog ping to avoid REST server NPE
iceberg-go v0.6.0 sends pageSize=20 unconditionally on ListNamespaces. The reference Iceberg REST server (iceberg-rest-fixture) then parses a null pageToken via Integer.parseInt, returning HTTP 500 NumberFormatException on every Ping. Suppress pagination with SetPageSize(ctx, 0) so the pageSize query param is omitted.
1 parent 9262184 commit 725e8f1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/infrastructure/iceberg/catalog/catalog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ func (c *Client) Warehouse() string {
9595

9696
// Ping verifies connectivity to the REST catalog by listing top-level namespaces.
9797
func (c *Client) Ping(ctx context.Context) error {
98+
// Disable pagination: the reference Iceberg REST server (iceberg-rest-fixture) throws
99+
// NumberFormatException on listNamespaces when a pageSize is sent without a pageToken.
100+
// iceberg-go sends pageSize=20 unconditionally, so suppress it to avoid the server bug.
101+
ctx = c.cat.SetPageSize(ctx, 0)
98102
_, err := c.cat.ListNamespaces(ctx, nil)
99103
if err != nil {
100104
return errors.WithMessage(err, "ping iceberg catalog")

0 commit comments

Comments
 (0)