Skip to content

[core][rest] Refine filtered partition listing and tests - #3

Merged
sundapeng merged 1 commit into
format-table-partition-filter-rest-apifrom
fix/format-table-partition-filter-review
Jul 22, 2026
Merged

[core][rest] Refine filtered partition listing and tests#3
sundapeng merged 1 commit into
format-table-partition-filter-rest-apifrom
fix/format-table-partition-filter-review

Conversation

@sundapeng

@sundapeng sundapeng commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up cleanup for apache/paimon#8785. It simplifies filtered partition listing, preserves paged REST responses, and strengthens the related tests.

Changes

  • Make the Catalog default filtered listing delegate to plain paged listing as a candidate superset.
  • Let CatalogFormatTablePartitionManager use the catalog contract directly without its own exception fallback.
  • Enforce partition-prefix matching while collecting each page and fail fast on invalid or repeated page tokens.
  • Preserve nextPageToken when a filtered REST response contains null partitions.
  • Fix the mock REST server partition lookup to use the full table identifier and expose narrow request-observation helpers.
  • Consolidate catalog-managed Format Table Spark tests and remove duplicate transport-oriented assertions.

Testing

  • Core/REST focused suites: 186 tests passed.
  • Java Spotless check passed.
  • git diff --check passed.

private final boolean dataTokenEnabled;
protected final Map<String, String> tableDefaultOptions;
private final @Nullable LocalCacheManager cacheManager;
private volatile FilteredPartitionListingSupport filteredPartitionListingSupport =

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

太复杂了,不要这些改动

return page;
} catch (NoSuchResourceException e) {
throw new TableNotExistException(identifier);
if (!canFallbackToPlainPartitionListing(pageToken)) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要这些改动

}
}

private boolean canFallbackToPlainPartitionListing(@Nullable String pageToken) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用刻意抽象

return page;
}

private enum FilteredPartitionListingSupport {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用引入


/** Bounds one request: catalog services cap the partitions a single call may carry. */
private static final int REQUEST_SIZE = 1000;
private static final int PARTITION_PAGE_SIZE = 1000;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用拆分

*/
private static boolean indicatesNoFilterListing(Exception exception) {
return exception instanceof UnsupportedOperationException
|| exception instanceof Catalog.TableNotExistException;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉这个是好的

@sundapeng
sundapeng force-pushed the fix/format-table-partition-filter-review branch from 5249027 to a371441 Compare July 22, 2026 02:43
@sundapeng sundapeng changed the title [core][rest] Refine filtered partition listing fallback [core][rest] Refine filtered partition listing and tests Jul 22, 2026
@sundapeng
sundapeng merged commit aaf9bb4 into format-table-partition-filter-rest-api Jul 22, 2026
25 checks passed
@sundapeng
sundapeng deleted the fix/format-table-partition-filter-review branch July 22, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant