apache/druid · error · UnsupportedOperationException

Predicate does not support ARRAY types

Error message

Predicate does not support ARRAY types

What it means

DruidPredicateFactory.makeArrayPredicate() is a default method that throws UOE because most filter implementations predate ARRAY column support and only supply string/long/float/double predicates. When a filter (e.g. an equality or in filter) is evaluated against an ARRAY-typed column and the vectorized selector asks for an object/array predicate, this error surfaces.

Solutions

  1. Use array-aware filters instead, e.g. the array_contains/array_overlap filters or an Expression filter over ARRAY_HAS/ARRAY_OVERLAP
  2. Implement makeArrayPredicate() in the custom DruidPredicateFactory
  3. Flatten arrays into separate rows or multi-value strings at ingestion if array filtering is not needed

Example fix

// before
new EqualityFilter("arrCol", null, "val", null) // scalar predicate on array column
// after
expressions.filter(DruidExpressions.fromExpressions("array_contains(\"arrCol\", 'val')"))
Defensive patterns

Strategy: fallback

Validate before calling

if (columnType.equals(ValueType.ARRAY) && !filter.supportsArrayPredicate()) {
  filter = buildArrayExpressionFilter(filter); // use ARRAY_HAS/ARRAY_OVERLAP expressions
}

Type guard

boolean arrayCapable = filter instanceof ExpressionFilter || filterSupportsArray(filter);

Try / catch

try {
  return runVectorized(query);
} catch (UOE e) {
  if (e.getMessage().contains("does not support ARRAY")) { return runNonVectorized(query); }
  throw e;
}

Prevention

When it happens

Trigger: Applying a filter whose DruidPredicateFactory does not implement makeArrayPredicate to an ARRAY-typed column, e.g. via vectorized matching on array-valued dimensions.

Common situations: Filtering on ARRAY-typed columns with predicates/filters that only support scalar types; mixing older custom filters with new array column types.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/query/filter/DruidPredicateFactory.java:42

import org.apache.druid.segment.column.TypeSignature;
import org.apache.druid.segment.column.ValueType;

import javax.annotation.Nullable;

@SubclassesMustOverrideEqualsAndHashCode
public interface DruidPredicateFactory
{
  DruidObjectPredicate<String> makeStringPredicate();

  DruidLongPredicate makeLongPredicate();

  DruidFloatPredicate makeFloatPredicate();

  DruidDoublePredicate makeDoublePredicate();

  default DruidObjectPredicate<Object[]> makeArrayPredicate(@Nullable TypeSignature<ValueType> inputType)
  {
    throw new UOE("Predicate does not support ARRAY types");
  }

  /**
   * Object predicate is currently only used by vectorized matchers for non-string object selectors. This currently
   * means it will be used only if we encounter COMPLEX types, but will also include array types once they are more
   * supported throughout the query engines.
   *
   * To preserve behavior with non-vectorized matchers which use a string predicate with null inputs for these 'nil'
   * matchers, we do the same thing here.
   *
   * @see org.apache.druid.segment.VectorColumnProcessorFactory#makeObjectProcessor
   */
  default DruidObjectPredicate<Object> makeObjectPredicate()
  {
    final DruidObjectPredicate<String> stringPredicate = makeStringPredicate();
    return o -> stringPredicate.apply(null);
  }
}

View on GitHub (pinned to 9b90983fd2)