{"record":{"id":"b99ad49becd0dd62","repo":"apache/druid","slug":"vectorized-expression-matchers-not-implemented-for","errorCode":null,"errorMessage":"Vectorized expression matchers not implemented for type: [%s]","messagePattern":"Vectorized expression matchers not implemented for type: \\[(.+?)\\]","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java","lineNumber":133,"sourceCode":"        ).makeMatcher(predicateFactory);\n      case STRING:\n        return VectorValueMatcherColumnProcessorFactory.instance().makeObjectProcessor(\n            ColumnCapabilitiesImpl.createSimpleSingleValueStringColumnCapabilities(),\n            ExpressionVectorSelectors.makeVectorObjectSelector(factory, theExpr, null)\n        ).makeMatcher(predicateFactory);\n      case ARRAY:\n        return VectorValueMatcherColumnProcessorFactory.instance().makeObjectProcessor(\n            ColumnCapabilitiesImpl.createDefault().setType(ExpressionType.toColumnType(outputType)).setHasNulls(true),\n            ExpressionVectorSelectors.makeVectorObjectSelector(factory, theExpr, null)\n        ).makeMatcher(predicateFactory);\n      default:\n        if (ExpressionType.NESTED_DATA.equals(outputType)) {\n          return VectorValueMatcherColumnProcessorFactory.instance().makeObjectProcessor(\n              ColumnCapabilitiesImpl.createDefault().setType(ExpressionType.toColumnType(outputType)).setHasNulls(true),\n              ExpressionVectorSelectors.makeVectorObjectSelector(factory, theExpr, null)\n          ).makeMatcher(predicateFactory);\n        }\n        throw new UOE(\"Vectorized expression matchers not implemented for type: [%s]\", outputType);\n    }\n  }\n\n  @Override\n  public ValueMatcher makeMatcher(final ColumnSelectorFactory factory)\n  {\n    final ColumnValueSelector<ExprEval> selector = ExpressionSelectors.makeExprEvalSelector(factory, expr.get());\n    return new ValueMatcher()\n    {\n      @Override\n      public boolean matches(boolean includeUnknown)\n      {\n        final ExprEval eval = selector.getObject();\n\n        if (includeUnknown && eval.value() == null) {\n          return true;\n        }\n","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/filter/ExpressionFilter.java#L115-L151","documentation":"ExpressionFilter.makeVectorMatcher only implements vectorized matchers for the expression output types it handles; when the expression's ExpressionType falls through to the default case it throws this UnsupportedOperationException. It means vectorized evaluation of this expression filter is unavailable for that output type, and the query must fall back to the row-by-row matcher.","triggerScenarios":"Evaluating an ExpressionFilter with vectorized query processing where the expression's output type (outputType from ExpressionType.fromString / factory bestEffortOutputType) hits the default branch of the switch, e.g. exotic or unsupported types not covered by the implemented cases.","commonSituations":"Vectorized queries filtering on expressions with complex/nested or less-common output types; Druid version where a type was added to ExpressionType but not yet supported by the vector matcher.","solutions":["Disable vectorization for the affected query/segment: set query context key druid.query.vectorize=false or use forceVectorize=false so the non-vector ValueMatcher path is used","Rewrite the expression so its output type is one of the supported vector types (e.g. cast the expression to LONG/DOUBLE/STRING)","Upgrade Druid to a version that implements vector matchers for the expression output type"],"exampleFix":"// before (query context)\n{\"query\":{\"filter\":{\"type\":\"expression\",\"expression\":\"json_value(x,'$.a') = 'b'\"}},\"vectorize\":true}\n// after\n{\"query\":{\"filter\":{\"type\":\"expression\",\"expression\":\"json_value(x,'$.a') = 'b'\"}},\"vectorize\":false}","handlingStrategy":"fallback","validationCode":"// Java: skip vector matching for unsupported expression output types\nExpressionType outputType = factory.bestEffortOutputTypeOf(theExpr);\nboolean vectorSupported = outputType.is(STRING, LONG, DOUBLE);\nqueryContext.put(\"vectorize\", vectorSupported ? \"true\" : \"false\");","typeGuard":"boolean vectorMatcherSupported(ExpressionType t) {\n  return ExpressionType.STRING.equals(t) || ExpressionType.LONG.equals(t)\n      || ExpressionType.DOUBLE.equals(t);\n}","tryCatchPattern":"try {\n  return makeVectorMatcher(bitmapIndexSelector);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"Vectorized expression matchers not implemented\")) {\n    return makeMatcher(rowSelectorFactory); // non-vector fallback\n  } else { throw e; }\n}","preventionTips":["Cast expressions to simple types (STRING/LONG/DOUBLE) when filtering so vectorization applies","Test expressions with vectorize=true before production rollout","Track Druid release notes for newly supported vector expression types"],"tags":["expression-filter","vectorized-query","unsupported-type"],"backgroundTag":"method-not-implemented","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}