apache/druid · error · UnsupportedOperationException

Filter[%s] cannot vectorize

Error message

Filter[%s] cannot vectorize

What it means

Filter.makeVectorMatcher is a default method that throws UOE because not every filter implementation supports vectorized (column-batch) evaluation. Calling it on a non-vectorizable filter yields this error; callers should first check canVectorize.

Source

Thrown at processing/src/main/java/org/apache/druid/query/filter/Filter.java:143

  BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector);

  /**
   * Get a {@link ValueMatcher} that applies this filter to row values.
   *
   * @param factory Object used to create ValueMatchers
   * @return ValueMatcher that applies this filter to row values.
   */
  ValueMatcher makeMatcher(ColumnSelectorFactory factory);

  /**
   * Get a {@link VectorValueMatcher} that applies this filter to row vectors.
   *
   * @param factory Object used to create ValueMatchers
   * @return VectorValueMatcher that applies this filter to row vectors.
   */
  default VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory factory)
  {
    throw new UOE("Filter[%s] cannot vectorize", getClass().getName());
  }

  /**
   * Returns true if this filter can produce a vectorized matcher from its "makeVectorMatcher" method.
   *
   * @param inspector Supplies type information for the selectors this filter will match against
   */
  default boolean canVectorizeMatcher(ColumnInspector inspector)
  {
    return false;
  }

  /**
   * Set of columns used by a filter.
   */
  Set<String> getRequiredColumns();

  /**

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Call filter.canVectorize(inspector) before requesting a vector matcher and fall back to the row-based path otherwise.
  2. Implement makeVectorMatcher in the custom filter, or wrap it in a supported filter type.
  3. Disable vectorization for the query (set vectorize=false / vectorize=false in query context) when using unsupported filters.

Example fix

// before
VectorValueMatcher m = filter.makeVectorMatcher(factory);
// after
if (filter.canVectorize(columnSelectorFactory)) {
  VectorValueMatcher m = filter.makeVectorMatcher(factory);
} else {
  // fall back to non-vectorized execution
}
Defensive patterns

Strategy: fallback

Validate before calling

if (!filter.canVectorize(columnSelectorFactory)) { /* use row-based path */ }

Type guard

boolean vectorizable = filter.canVectorize(factory);

Try / catch

try { matcher = filter.makeVectorMatcher(factory); } catch (UnsupportedOperationException e) { matcher = null; /* fallback to non-vectorized cursor */ }

Prevention

When it happens

Trigger: Invoking makeVectorMatcher on a filter class that does not override it (e.g. a custom filter, or filters like expression/array filters in some configurations) while running a vectorized query engine.

Common situations: Custom user filters plugged into Druid; queries forced to the vectorized engine via forceVectorize where a filter lacks vector support.

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/02feae618bd4fdcd. Report an issue: GitHub.