{"record":{"id":"02feae618bd4fdcd","repo":"apache/druid","slug":"filter-s-cannot-vectorize","errorCode":null,"errorMessage":"Filter[%s] cannot vectorize","messagePattern":"Filter\\[(.+?)\\] cannot vectorize","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/filter/Filter.java","lineNumber":143,"sourceCode":"  BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector);\n\n  /**\n   * Get a {@link ValueMatcher} that applies this filter to row values.\n   *\n   * @param factory Object used to create ValueMatchers\n   * @return ValueMatcher that applies this filter to row values.\n   */\n  ValueMatcher makeMatcher(ColumnSelectorFactory factory);\n\n  /**\n   * Get a {@link VectorValueMatcher} that applies this filter to row vectors.\n   *\n   * @param factory Object used to create ValueMatchers\n   * @return VectorValueMatcher that applies this filter to row vectors.\n   */\n  default VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory factory)\n  {\n    throw new UOE(\"Filter[%s] cannot vectorize\", getClass().getName());\n  }\n\n  /**\n   * Returns true if this filter can produce a vectorized matcher from its \"makeVectorMatcher\" method.\n   *\n   * @param inspector Supplies type information for the selectors this filter will match against\n   */\n  default boolean canVectorizeMatcher(ColumnInspector inspector)\n  {\n    return false;\n  }\n\n  /**\n   * Set of columns used by a filter.\n   */\n  Set<String> getRequiredColumns();\n\n  /**","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/filter/Filter.java#L125-L161","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom user filters plugged into Druid; queries forced to the vectorized engine via forceVectorize where a filter lacks vector support.","solutions":["Call filter.canVectorize(inspector) before requesting a vector matcher and fall back to the row-based path otherwise.","Implement makeVectorMatcher in the custom filter, or wrap it in a supported filter type.","Disable vectorization for the query (set vectorize=false / vectorize=false in query context) when using unsupported filters."],"exampleFix":"// before\nVectorValueMatcher m = filter.makeVectorMatcher(factory);\n// after\nif (filter.canVectorize(columnSelectorFactory)) {\n  VectorValueMatcher m = filter.makeVectorMatcher(factory);\n} else {\n  // fall back to non-vectorized execution\n}","handlingStrategy":"fallback","validationCode":"if (!filter.canVectorize(columnSelectorFactory)) { /* use row-based path */ }","typeGuard":"boolean vectorizable = filter.canVectorize(factory);","tryCatchPattern":"try { matcher = filter.makeVectorMatcher(factory); } catch (UnsupportedOperationException e) { matcher = null; /* fallback to non-vectorized cursor */ }","preventionTips":["Check canVectorize before requesting a vector matcher","Avoid forcing vectorize=true with custom or exotic filters","Test new Filter implementations against the vector engine"],"tags":["druid","vectorization","filter","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}