{"record":{"id":"42a9b6c49adedfef","repo":"apache/druid","slug":"column-name-must-be-provided-and-non-empty","errorCode":null,"errorMessage":"Column name must be provided and non-empty","messagePattern":"Column name must be provided and non-empty","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/column/ColumnSignature.java","lineNumber":53,"sourceCode":"class ColumnSignature\n{\n  private final String name;\n\n  @Nullable\n  private final ColumnType type;\n\n  @JsonCreator\n  ColumnSignature(\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"type\") @Nullable ColumnType type\n  )\n  {\n    this.name = name;\n    this.type = type;\n\n    // Name must be nonnull, but type can be null (if the type is unknown)\n    if (name == null || name.isEmpty()) {\n      throw new IAE(\"Column name must be provided and non-empty\");\n    }\n  }\n\n  @JsonProperty(\"name\")\n  String name()\n  {\n    return name;\n  }\n\n  @Nullable\n  @JsonProperty(\"type\")\n  @JsonInclude(JsonInclude.Include.NON_NULL)\n  ColumnType type()\n  {\n    return type;\n  }\n\n  @Override","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/column/ColumnSignature.java#L35-L71","documentation":"Constructor validation guard for the ColumnSignature record: the JSON-deserialized or programmatically built column signature must carry a name, since every signature in a segment's column-signature set is keyed by its column name and an empty/null name would be ambiguous. It fires when a signature is constructed with a missing or empty 'name' property (e.g. malformed metadata JSON or a caller passing null); supply a non-empty column name. A null type is explicitly allowed.","triggerScenarios":"Constructing ColumnSignature (directly or via its factories/JSON deserialization) with name == null or name.isEmpty().","commonSituations":"Hand-building signatures in code/tests without a name; JSON payloads missing the \"name\" field; downstream planner code producing a signature for an anonymous/generated column.","solutions":["Pass a non-empty column name to the constructor","If deserializing from JSON, include the required \"name\" property","Trace the upstream planner/datasource code that yields an empty name and fix it to propagate the real column identifier"],"exampleFix":"// before\nnew ColumnSignature(null, ColumnType.LONG);\n// after\nnew ColumnSignature(\"myColumn\", ColumnType.LONG);","handlingStrategy":"validation","validationCode":"if (name == null || name.isEmpty()) { throw new IllegalArgumentException(\"Column name required\"); }\nColumnSignature sig = new ColumnSignature(name, type);","typeGuard":"static boolean isValidColumnName(String n) { return n != null && !n.isEmpty(); }","tryCatchPattern":"try { new ColumnSignature(name, type); } catch (IAE e) { /* reject payload and report missing name */ }","preventionTips":["Validate JSON payloads include a non-empty \"name\" field before deserialization","Use non-empty constants for generated columns","Add constructor-argument assertions in calling code"],"tags":["druid","column-signature","empty-required-field"],"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-14T05:17:10.506Z"}