Skip to content

Conversation

@huaxingao
Copy link
Contributor

Follows OpenAPI spec update in #14730 to support Idempotency-Key on mutating scan planning endpoints.

@github-actions github-actions bot added the core label Jan 20, 2026
@singhpk234 singhpk234 self-requested a review January 21, 2026 01:25
Comment on lines 242 to 262
private String planPath(TableIdentifier ident) {
return String.format(
"v1/namespaces/%s/tables/%s/plan",
RESTUtil.encodeNamespace(ident.namespace(), RESTUtil.NAMESPACE_SEPARATOR_URLENCODED_UTF_8),
RESTUtil.encodeString(ident.name()));
}

private String tasksPath(TableIdentifier ident) {
return String.format(
"v1/namespaces/%s/tables/%s/tasks",
RESTUtil.encodeNamespace(ident.namespace(), RESTUtil.NAMESPACE_SEPARATOR_URLENCODED_UTF_8),
RESTUtil.encodeString(ident.name()));
}

private String cancelPath(TableIdentifier ident, String planId) {
return String.format(
"v1/namespaces/%s/tables/%s/plan/%s",
RESTUtil.encodeNamespace(ident.namespace(), RESTUtil.NAMESPACE_SEPARATOR_URLENCODED_UTF_8),
RESTUtil.encodeString(ident.name()),
RESTUtil.encodeString(planId));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks!

FetchScanTasksResponse.class,
ErrorHandlers.planTaskHandler());

// We cancel the planning state before this call, so a *fresh execution* of fetchScanTasks would
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// We cancel the planning state before this call, so a *fresh execution* of fetchScanTasks would
// We cancel the planning state before this call, so a fresh execution of fetchScanTasks would

??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 1133 to 1142
List<PlanTableScanResponse> responses =
executeTwice(
HTTPRequest.HTTPMethod.POST,
planPath(ident),
headers,
request,
PlanTableScanResponse.class,
ErrorHandlers.tableErrorHandler());
PlanTableScanResponse first = responses.get(0);
PlanTableScanResponse second = responses.get(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

i am not sure if execute twice is getting something here we any ways are writing 2 loc to get the first and the second invocation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed executeTwice doesn’t really reduce verbosity here. I’ve updated the test to use two explicit execute(...) calls for first and second to make the two invocations unambiguous

Comment on lines 1197 to 1198
// identifiers (data file locations) to the first response. Use order-insensitive comparison
// since task ordering isn't guaranteed.
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't the task ordering gauranteed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In CatalogHandlers.planFilesFor, we iterate scan.planFiles() and directly Iterables.partition(planTasks, tasksPerPlanTask) without sorting, so task order is whatever planFiles() yields and isn’t guaranteed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants