Commit b2f9743
committed
Fix Paginator dropping results on empty token pages (DECO-27280)
The Paginator stopped iterating at the first empty page even when the
response carried a valid next_page_token, silently dropping results on
later pages. Token-paginated endpoints (e.g. tables().list) can return
empty intermediate pages with a token (UC filters out non-listable items),
so the SDK could under-return — in the reported case it returned 0 tables
where Python returned 23.
Replace the public Paginator constructor with two explicit factories:
- Paginator.newTokenPagination: iterate until nextPageFn returns null;
empty pages are skipped, not treated as the end of results.
- Paginator.newOffsetPagination: stop on the first empty page (offset/
SCIM/legacy-SQL APIs have no token and rely on this).
The constructor is now private, so every call site must state its strategy.
Regenerated all *API.java list methods to the appropriate factory (token
APIs and clusters/events -> newTokenPagination; offset/SCIM/legacy-SQL ->
newOffsetPagination) via the genkit java template change. Hand-written
APIs updated manually: SharesExtAPI -> newTokenPagination; the SCIM
Users/Groups/ServicePrincipals (and Account* variants) -> newOffsetPagination.
PaginatorTest covers empty leading/intermediate token pages and offset
stop-on-empty. Full SDK recompiled (mvn clean compile, 3902 sources).
Signed-off-by: Hector Castejon Diaz <hector.castejon@databricks.com>1 parent f8c4aa7 commit b2f9743
124 files changed
Lines changed: 349 additions & 181 deletions
File tree
- databricks-sdk-java/src
- main/java/com/databricks/sdk
- service
- apps
- billing
- bundle
- catalog
- cleanrooms
- compute
- dashboards
- database
- dataquality
- disasterrecovery
- environments
- files
- iam
- jobs
- knowledgeassistants
- marketplace
- ml
- networking
- oauth2
- pipelines
- postgres
- qualitymonitorv2
- serving
- settingsv2
- settings
- sharing
- sql
- supervisoragents
- tags
- vectorsearch
- workspace
- support
- test/java/com/databricks/sdk/support
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments