{"record":{"id":"64278df43f50a8b3","repo":"apache/druid","slug":"column-name-is-required-64278d","errorCode":null,"errorMessage":"Column name is required","messagePattern":"Column name is required","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/TableBuilder.java","lineNumber":189,"sourceCode":"  {\n    return property(ExternalTableDefn.FORMAT_PROPERTY, format);\n  }\n\n  public TableBuilder columns(List<ColumnSpec> columns)\n  {\n    this.columns = columns;\n    return this;\n  }\n\n  public List<ColumnSpec> columns()\n  {\n    return columns;\n  }\n\n  public TableBuilder column(ColumnSpec column)\n  {\n    if (Strings.isNullOrEmpty(column.name())) {\n      throw new IAE(\"Column name is required\");\n    }\n    columns.add(column);\n    return this;\n  }\n\n  public TableBuilder timeColumn()\n  {\n    return column(Columns.TIME_COLUMN, Columns.LONG);\n  }\n\n  public TableBuilder column(String name, String sqlType)\n  {\n    return column(name, sqlType, null);\n  }\n\n  public TableBuilder column(String name, String sqlType, Map<String, Object> properties)\n  {\n    Preconditions.checkNotNull(tableType);","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/TableBuilder.java#L171-L207","documentation":"Thrown by TableBuilder.column(ColumnSpec) when the supplied ColumnSpec has a null or empty name. The catalog table builder requires every column to carry a non-empty name before it can be added to a table specification.","triggerScenarios":"Calling TableBuilder.column(new ColumnSpec()) or any ColumnSpec built without setName(...)/a name argument; programmatically constructing column specs where the name field was never populated.","commonSituations":"Building table specs dynamically from metadata where a column name source returned null/empty; forgetting to set the name on a ColumnSpec before adding it.","solutions":["Set a non-empty name on the ColumnSpec before passing it to column().","Check the source of the column name (metadata query, JSON parse) for null or empty values.","Validate the ColumnSpec (name != null && !name.isEmpty()) before adding it to the builder."],"exampleFix":"// before\nbuilder.column(new ColumnSpec(null, type));\n// after\nbuilder.column(new ColumnSpec(\"userId\", type));","handlingStrategy":"validation","validationCode":"if (columnSpec.name() == null || columnSpec.name().isEmpty()) {\n  throw new IllegalArgumentException(\"ColumnSpec must have a non-empty name\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set the name when constructing a ColumnSpec (require it in your factory).","Sanity-check data sources of column names for null/empty entries.","Add an assert on name before calling builder.column()."],"tags":["druid","catalog","validation","columns"],"backgroundTag":"missing-required-argument","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}