apache/druid · error · IllegalArgumentException
parameter cannot be a blank string
Error message
%s parameter cannot be a blank string
What it means
CatalogUtils.getNonBlankString reads a string-valued parameter from a catalog/model argument map and rejects it when the value, after trimming, is empty. The catalog model layer requires meaningful non-blank values for such parameters (e.g. table or column properties), so whitespace-only strings are treated as invalid even though they are not null.
Solutions
- Set the named parameter to a non-blank string value in the catalog spec or argument map.
- If the parameter is optional, remove the key entirely instead of supplying an empty string (getNonBlankString returns null for absent keys).
- Trim-check user input before submitting the catalog definition: if (s == null || s.trim().isEmpty()) fail fast with a clearer message.
Example fix
// before
{"properties": {"name": " "}}
// after
{"properties": {"name": "my_table"}} Defensive patterns
Strategy: validation
Validate before calling
Object v = args.get("param");
if (v instanceof String && ((String) v).trim().isEmpty()) {
throw new IllegalArgumentException("param must be a non-blank string or omitted");
} Type guard
boolean isPresentNonBlank(Object v) { return v instanceof String && !((String) v).trim().isEmpty(); } Try / catch
try { String s = CatalogUtils.getNonBlankString(args, "param"); ... } catch (IllegalArgumentException e) { log.error("Invalid catalog parameter: %s", e.getMessage()); } Prevention
- Omit optional keys entirely instead of setting them to "".
- Trim user input at config-load time and reject blank values early.
- Lint catalog JSON/YAML specs for empty-string property values before submission.
When it happens
Trigger: Calling getNonBlankString(args, "x") where args.get("x") is "", " ", or any whitespace-only string. Also occurs via CatalogUtils validation paths that call getNonBlankString on user-supplied catalog spec properties.
Common situations: A user defines a catalog table or column spec in JSON/YAML and leaves a required property set to an empty string (e.g. "description": "" or "name": ""); copy-paste of config that wiped a value; templating that substituted an empty variable.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- A table definition must include a table spec.
- An external HTTP table with a URI must also provide the…
- An external HTTP table with a URI must also provide the…
- An external S3 table with a format must also provide the…
- At least one of baseDir or files should be specified
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/d293d1e1cfc691d3.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java:210
)
{
return Stream
.of(base, additions)
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.collect(Collectors.toList());
}
/**
* Get a string parameter that can either be null or non-blank.
*/
public static String getNonBlankString(Map<String, Object> args, String parameter)
{
String value = CatalogUtils.getString(args, parameter);
if (value != null) {
value = value.trim();
if (value.isEmpty()) {
throw new IAE("%s parameter cannot be a blank string", parameter);
}
}
return value;
}
public static List<String> getUriListArg(Map<String, Object> args, String parameter)
{
String urisString = CatalogUtils.getString(args, parameter);
if (Strings.isNullOrEmpty(urisString)) {
throw new IAE("One or more values are required for parameter %s", parameter);
}
return stringToList(urisString);
}
public static List<URI> stringToUriList(String uris)
{
return stringListToUriList(stringToList(uris));
}View on GitHub (pinned to 9b90983fd2)