apache/druid · error · IllegalArgumentException

MinTime not supported!

Error message

MinTime not supported!

What it means

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.

Source

Thrown at processing/src/main/java/org/apache/druid/query/timeboundary/TimeBoundaryResultValue.java:68

  }

  @Nullable
  public DateTime getMaxTime()
  {
    if (value instanceof Map) {
      return getDateTimeValue(((Map) value).get(TimeBoundaryQuery.MAX_TIME));
    } else {
      return getDateTimeValue(value);
    }
  }

  @Nullable
  public DateTime getMinTime()
  {
    if (value instanceof Map) {
      return getDateTimeValue(((Map) value).get(TimeBoundaryQuery.MIN_TIME));
    } else {
      throw new IAE("MinTime not supported!");
    }
  }

  @Override
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    TimeBoundaryResultValue that = (TimeBoundaryResultValue) o;

    return Objects.equals(value, that.value);
  }

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Inspect the TimeBoundaryResultValue's underlying value type and ensure it is a Map containing TimeBoundaryQuery.MIN_TIME
  2. Use getMaxTime()/getMinTime() only on results returned by TimeBoundaryQuery run through the standard engine
  3. If constructing results manually, wrap values in a Map with keys MIN_TIME/MAX_TIME
  4. Add a custom deserializer so results keep their Map structure across the wire

Example fix

// before
DateTime t = new TimeBoundaryResultValue(DateTimes.nowDateTime()).getMinTime(); // throws
// after
Map<String, Object> val = ImmutableMap.of(TimeBoundaryQuery.MIN_TIME, DateTimes.nowDateTime());
DateTime t = new TimeBoundaryResultValue(val).getMinTime();
Defensive patterns

Strategy: validation

Validate before calling

boolean safe = tbResultValue != null && tbResultValue.getValue() instanceof Map && ((Map<?, ?>) tbResultValue.getValue()).containsKey(TimeBoundaryQuery.MIN_TIME);

Type guard

static boolean hasMinTime(TimeBoundaryResultValue v) {
  return v != null && v.getValue() instanceof Map<?, ?> m && m.containsKey(TimeBoundaryQuery.MIN_TIME);
}

Try / catch

try { DateTime t = value.getMinTime(); } catch (IllegalArgumentException e) { log.error("TimeBoundary result lacks MIN_TIME map", e); t = null; }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/28c094fed036861e. Report an issue: GitHub.