{"record":{"id":"4752ecf264c252f3","repo":"apache/druid","slug":"cannot-hide-column-s","errorCode":null,"errorMessage":"Cannot hide column %s","messagePattern":"Cannot hide column (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java","lineNumber":152,"sourceCode":"  }\n\n  public static class HiddenColumnsDefn extends StringListPropertyDefn\n  {\n    public HiddenColumnsDefn()\n    {\n      super(HIDDEN_COLUMNS_PROPERTY);\n    }\n\n    @Override\n    public void validate(Object value, ObjectMapper jsonMapper)\n    {\n      if (value == null) {\n        return;\n      }\n      List<String> hiddenColumns = decode(value, jsonMapper);\n      for (String col : hiddenColumns) {\n        if (Columns.TIME_COLUMN.equals(col)) {\n          throw new IAE(\n              StringUtils.format(\"Cannot hide column %s\", col)\n          );\n        }\n      }\n    }\n  }\n\n  public static class ClusterKeysDefn extends ModelProperties.ListPropertyDefn<ClusterKeySpec>\n  {\n    public ClusterKeysDefn()\n    {\n      super(\n          CLUSTER_KEYS_PROPERTY,\n          \"ClusterKeySpec list\",\n          new TypeReference<>() {}\n      );\n    }\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java#L134-L170","documentation":"DatasourceDefn validation rejects attempts to hide the __time column. The __time primary time column is fundamental to Druid segmentation and cannot be marked hidden in a datasource definition's hiddenColumns property.","triggerScenarios":"Creating or updating a datasource whose 'hiddenColumns' property includes '__time'; the validate method decodes the value and throws when any entry equals Columns.TIME_COLUMN.","commonSituations":"Copy-pasting a full column list into hiddenColumns including __time; tooling auto-generating hidden columns from a schema snapshot; trying to 'remove' the time column from output.","solutions":["Remove '__time' from the hiddenColumns list in the datasource spec.","Use a query-level projection instead to exclude __time from results.","Filter the desired hidden columns before saving the spec.","If __time must not appear, alias/select only needed columns in SQL."],"exampleFix":"// before\n\"hiddenColumns\": [\"__time\", \"userId\"]\n// after\n\"hiddenColumns\": [\"userId\"]","handlingStrategy":"validation","validationCode":"List<String> hidden = spec.getHiddenColumns();\nif (hidden != null && hidden.contains(\"__time\")) {\n  throw new IllegalArgumentException(\"__time cannot be hidden\");\n}","typeGuard":null,"tryCatchPattern":"try { saveSpec(spec); } catch (IAE e) { if (e.getMessage().startsWith(\"Cannot hide column\")) { spec.setHiddenColumns(remove(spec.getHiddenColumns(), \"__time\")); saveSpec(spec); } }","preventionTips":["Never include __time in hiddenColumns","Filter the column list before persisting specs","Use query projections to exclude __time from results","Review auto-generated hidden column lists for __time"],"tags":["druid","catalog","datasource","hidden-columns"],"backgroundTag":"invalid-config-value","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"}