markhoerth opened a new pull request, #14456: URL: https://github.com/apache/gravitino/pull/14456
Backport to branch-1.3 of the fix for #14454 (same change as the PR to main; it applies cleanly). ### What changes were proposed in this pull request? `IcebergPaginationHelper.paginate` returns all results with no next-page token when the request has no `pageToken` parameter (`Optional.empty()`), whatever `pageSize` says. An empty or non-empty `pageToken` pages as before. `pageSize` is still validated when present. ### Why are the changes needed? The REST spec requires all results when `pageToken` is not set; clients sending only `pageSize` received a silently truncated list. Fixes #14454 ### Does this PR introduce _any_ user-facing change? Yes. List namespaces, tables and views with `pageSize` and no `pageToken` return all results. To page, send an empty `pageToken` on the first request, as the spec describes and the Iceberg Java client does. ### How was this patch tested? - `TestIcebergPaginationHelper#testPageSizeWithoutPageTokenReturnsAllResults`. - Existing pagination tests (helper and HTTP tests for namespaces, tables and views) used `pageSize` alone to start paging. They now send an empty `pageToken`. `./gradlew :iceberg:iceberg-rest-server:test -PskipITs` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Eu6fb9pLfmrSJzGQDVLi1g -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
