{"record":{"id":"d293d1e1cfc691d3","repo":"apache/druid","slug":"s-parameter-cannot-be-a-blank-string","errorCode":null,"errorMessage":"%s parameter cannot be a blank string","messagePattern":"(.+?) parameter cannot be a blank string","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java","lineNumber":210,"sourceCode":"  )\n  {\n    return Stream\n        .of(base, additions)\n        .filter(Objects::nonNull)\n        .flatMap(Collection::stream)\n        .collect(Collectors.toList());\n  }\n\n  /**\n   * Get a string parameter that can either be null or non-blank.\n   */\n  public static String getNonBlankString(Map<String, Object> args, String parameter)\n  {\n    String value = CatalogUtils.getString(args, parameter);\n    if (value != null) {\n      value = value.trim();\n      if (value.isEmpty()) {\n        throw new IAE(\"%s parameter cannot be a blank string\", parameter);\n      }\n    }\n    return value;\n  }\n\n  public static List<String> getUriListArg(Map<String, Object> args, String parameter)\n  {\n    String urisString = CatalogUtils.getString(args, parameter);\n    if (Strings.isNullOrEmpty(urisString)) {\n      throw new IAE(\"One or more values are required for parameter %s\", parameter);\n    }\n    return stringToList(urisString);\n  }\n\n  public static List<URI> stringToUriList(String uris)\n  {\n    return stringListToUriList(stringToList(uris));\n  }","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java#L192-L228","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n{\"properties\": {\"name\": \"   \"}}\n// after\n{\"properties\": {\"name\": \"my_table\"}}","handlingStrategy":"validation","validationCode":"Object v = args.get(\"param\");\nif (v instanceof String && ((String) v).trim().isEmpty()) {\n  throw new IllegalArgumentException(\"param must be a non-blank string or omitted\");\n}","typeGuard":"boolean isPresentNonBlank(Object v) { return v instanceof String && !((String) v).trim().isEmpty(); }","tryCatchPattern":"try { String s = CatalogUtils.getNonBlankString(args, \"param\"); ... } catch (IllegalArgumentException e) { log.error(\"Invalid catalog parameter: %s\", e.getMessage()); }","preventionTips":["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."],"tags":["catalog","validation","blank-string","config"],"backgroundTag":"empty-required-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}