{"record":{"id":"3997cda63996c889","repo":"apache/druid","slug":"unsupported-segment-graularity-please-use-an-equi","errorCode":null,"errorMessage":"Unsupported segment graularity. Please use an equivalent of these granularities: %s.","messagePattern":"Unsupported segment graularity\\. Please use an equivalent of these granularities: (.+?)\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java","lineNumber":294,"sourceCode":"        Object value = entry.getValue();\n        final PropertyDefn<?> propDefn = properties.get(entry.getKey());\n        if (propDefn != null) {\n          value = propDefn.merge(merged.get(entry.getKey()), entry.getValue());\n        }\n        merged.put(entry.getKey(), value);\n      }\n    }\n    return merged;\n  }\n\n  public static void validateGranularity(final String value)\n  {\n    if (value == null) {\n      return;\n    }\n    final Granularity granularity = asDruidGranularity(value);\n    if (!GranularityType.isStandard(granularity)) {\n      throw new IAE(\n          \"Unsupported segment graularity. \"\n          + \"Please use an equivalent of these granularities: %s.\",\n          Arrays.stream(GranularityType.values())\n                .filter(granularityType -> !granularityType.equals(GranularityType.NONE))\n                .map(Enum::name)\n                .map(StringUtils::toLowerCase)\n                .collect(Collectors.joining(\", \"))\n      );\n    }\n  }\n\n  public static int findColumn(List<ColumnSpec> columns, String colName)\n  {\n    for (int i = 0; i < columns.size(); i++) {\n      if (columns.get(i).name().equals(colName)) {\n        return i;\n      }\n    }","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/CatalogUtils.java#L276-L312","documentation":"CatalogUtils.validateGranularity rejects granularity values that are not one of Druid's standard GranularityTypes (second through year, etc.). Druid segments require a standard granularity; arbitrary custom periods are not accepted for segment partitioning.","triggerScenarios":"Setting a catalog/table segment granularity property to a non-standard granularity such as a custom Period (e.g. PT37M), a derived granularity object, or NONE. Reached via validateGranularity when asDruidGranularity yields a non-standard granularity.","commonSituations":"Users configure a custom retention/rollup period like 10-minute or 37-minute granularity; config generated programmatically builds a Granularity from a period string that doesn't match a standard type; typo in a granularity name resolves to an odd period.","solutions":["Change the granularity to a standard value: second, minute, fifteen_minute, thirty_minute, hour, day, week, month, quarter, or year.","If a custom bucket is required, partition/rollup upstream before ingest and keep segment granularity standard.","Check for typos or a period string (e.g. \"P1MT6H\") that is not equivalent to a standard granularity."],"exampleFix":"// before\n\"segmentGranularity\": {\"type\": \"period\", \"period\": \"PT37M\"}\n// after\n\"segmentGranularity\": \"hour\"","handlingStrategy":"validation","validationCode":"Granularity g = CatalogUtils.asDruidGranularity(value);\nif (g != null && !GranularityType.isStandard(g)) {\n  throw new IllegalArgumentException(\"segmentGranularity must be a standard Druid granularity\");\n}","typeGuard":"boolean isStandardGranularity(String name) {\n  try { return GranularityType.isStandard(GranularityType.fromString(name).getDefaultGranularity()); }\n  catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try { CatalogUtils.validateGranularity(value); } catch (IllegalArgumentException e) { // surface list of allowed granularities from e.getMessage() to the user }","preventionTips":["Only use the named standard granularities (second..year) for segment granularity.","Do custom bucketing upstream of Druid; keep segment granularity standard.","Reject period-string configs like PT37M at config-validation time."],"tags":["catalog","granularity","validation","druid"],"backgroundTag":"invalid-enum-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"}