apache/iceberg · error · UnsupportedOperationException
Query params are not supported
Error message
Query params are not supported
What it means
The RESTClient default delete(path, queryParams, ...) convenience overload does not support query parameters; it throws UnsupportedOperationException if any are passed and delegates to the plain delete. Callers needing query parameters must use an overload/client that supports them.
Solutions
- Use the delete overload without queryParams, encoding needed values into the path
- Use a concrete RESTClient implementation (e.g. HttpClient) that supports deletes with query params, if available
- Drop query parameters if the endpoint does not require them
- Encode filters into path segments where the REST spec defines them
Example fix
// before
client.delete("v1/namespaces/ns/tables", ImmutableMap.of("purge", "true"), respType, headers, handler);
// after
client.delete("v1/namespaces/ns/tables/purge", respType, headers, handler); Defensive patterns
Strategy: validation
Validate before calling
if (queryParams != null && !queryParams.isEmpty()) {
throw new IllegalArgumentException("Use delete without queryParams or a header-capable client");
} Try / catch
try {
return client.delete(path, queryParams, type, headers, handler);
} catch (UnsupportedOperationException e) {
return client.delete(path, type, headers, handler); // fallback
} Prevention
- Encode filters into the request path per the REST spec, not query params
- Check overload signatures before porting HTTP calls
- Prefer the minimal delete overload unless you need params
- Document which RESTClient overloads your concrete client supports
When it happens
Trigger: Calling restClient.delete(path, queryParams, responseType, headers, errorHandler) with a non-empty/non-null queryParams map; porting GET-style code (with filters encoded as query params) to DELETE without adjusting the call.
Common situations: Migrating code from other HTTP clients to RESTClient; trying to add filters or pagination params to a DELETE call; using the convenience overload out of habit.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Parser context is not supported
- Returning response headers is not supported
- Default values are not supported
- Managing snapshots is not supported by +…
- doesn't implement cleanExpiredMetadata
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/d0f06a4d4b2e9ffb.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/apache/iceberg/rest/RESTClient.java:69
Supplier<Map<String, String>> headers,
Consumer<ErrorResponse> errorHandler) {
return delete(path, ImmutableMap.of(), responseType, headers.get(), errorHandler);
}
<T extends RESTResponse> T delete(
String path,
Class<T> responseType,
Map<String, String> headers,
Consumer<ErrorResponse> errorHandler);
default <T extends RESTResponse> T delete(
String path,
Map<String, String> queryParams,
Class<T> responseType,
Map<String, String> headers,
Consumer<ErrorResponse> errorHandler) {
if (null != queryParams && !queryParams.isEmpty()) {
throw new UnsupportedOperationException("Query params are not supported");
}
return delete(path, responseType, headers, errorHandler);
}
default <T extends RESTResponse> T get(
String path,
Class<T> responseType,
Supplier<Map<String, String>> headers,
Consumer<ErrorResponse> errorHandler) {
return get(path, ImmutableMap.of(), responseType, headers, errorHandler);
}
default <T extends RESTResponse> T get(
String path,
Class<T> responseType,
Map<String, String> headers,
Consumer<ErrorResponse> errorHandler) {View on GitHub (pinned to 86d9c8fc54)