{"record":{"id":"28c094fed036861e","repo":"apache/druid","slug":"mintime-not-supported","errorCode":null,"errorMessage":"MinTime not supported!","messagePattern":"MinTime not supported!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryResultValue.java","lineNumber":68,"sourceCode":"  }\n\n  @Nullable\n  public DateTime getMaxTime()\n  {\n    if (value instanceof Map) {\n      return getDateTimeValue(((Map) value).get(TimeBoundaryQuery.MAX_TIME));\n    } else {\n      return getDateTimeValue(value);\n    }\n  }\n\n  @Nullable\n  public DateTime getMinTime()\n  {\n    if (value instanceof Map) {\n      return getDateTimeValue(((Map) value).get(TimeBoundaryQuery.MIN_TIME));\n    } else {\n      throw new IAE(\"MinTime not supported!\");\n    }\n  }\n\n  @Override\n  public boolean equals(Object o)\n  {\n    if (this == o) {\n      return true;\n    }\n    if (o == null || getClass() != o.getClass()) {\n      return false;\n    }\n\n    TimeBoundaryResultValue that = (TimeBoundaryResultValue) o;\n\n    return Objects.equals(value, that.value);\n  }\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryResultValue.java#L50-L86","documentation":"TimeBoundaryResultValue wraps the result value of a TimeBoundaryQuery. getMinTime() extracts the MIN_TIME field, but only when the underlying value is a Map; otherwise the result value is in an unexpected shape and the library throws IAE(\"MinTime not supported!\") rather than returning a wrong/ambiguous value.","triggerScenarios":"Calling getMinTime() on a TimeBoundaryResultValue whose internal value is not a Map (e.g. a raw DateTime or wrapper produced by a custom/legacy result format or a deserialized result that lost its map structure).","commonSituations":"Custom query result serialization (custom Serde), upgrading Druid versions where TimeBoundary result shape changed, or client code constructing TimeBoundaryResultValue manually with a non-map value.","solutions":["Inspect the TimeBoundaryResultValue's underlying value type and ensure it is a Map containing TimeBoundaryQuery.MIN_TIME","Use getMaxTime()/getMinTime() only on results returned by TimeBoundaryQuery run through the standard engine","If constructing results manually, wrap values in a Map with keys MIN_TIME/MAX_TIME","Add a custom deserializer so results keep their Map structure across the wire"],"exampleFix":"// before\nDateTime t = new TimeBoundaryResultValue(DateTimes.nowDateTime()).getMinTime(); // throws\n// after\nMap<String, Object> val = ImmutableMap.of(TimeBoundaryQuery.MIN_TIME, DateTimes.nowDateTime());\nDateTime t = new TimeBoundaryResultValue(val).getMinTime();","handlingStrategy":"validation","validationCode":"boolean safe = tbResultValue != null && tbResultValue.getValue() instanceof Map && ((Map<?, ?>) tbResultValue.getValue()).containsKey(TimeBoundaryQuery.MIN_TIME);","typeGuard":"static boolean hasMinTime(TimeBoundaryResultValue v) {\n  return v != null && v.getValue() instanceof Map<?, ?> m && m.containsKey(TimeBoundaryQuery.MIN_TIME);\n}","tryCatchPattern":"try { DateTime t = value.getMinTime(); } catch (IllegalArgumentException e) { log.error(\"TimeBoundary result lacks MIN_TIME map\", e); t = null; }","preventionTips":["Only consume TimeBoundaryResultValue from standard engine results","Never construct TimeBoundaryResultValue with a bare DateTime","Keep query result serde versions aligned across cluster"],"tags":["druid","query-results","type-mismatch","timeboundary"],"backgroundTag":"unexpected-response-shape","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"}