{"record":{"id":"8cce9378181209b8","repo":"apache/druid","slug":"predicate-does-not-support-array-types","errorCode":null,"errorMessage":"Predicate does not support ARRAY types","messagePattern":"Predicate does not support ARRAY types","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/filter/DruidPredicateFactory.java","lineNumber":42,"sourceCode":"import org.apache.druid.segment.column.TypeSignature;\nimport org.apache.druid.segment.column.ValueType;\n\nimport javax.annotation.Nullable;\n\n@SubclassesMustOverrideEqualsAndHashCode\npublic interface DruidPredicateFactory\n{\n  DruidObjectPredicate<String> makeStringPredicate();\n\n  DruidLongPredicate makeLongPredicate();\n\n  DruidFloatPredicate makeFloatPredicate();\n\n  DruidDoublePredicate makeDoublePredicate();\n\n  default DruidObjectPredicate<Object[]> makeArrayPredicate(@Nullable TypeSignature<ValueType> inputType)\n  {\n    throw new UOE(\"Predicate does not support ARRAY types\");\n  }\n\n  /**\n   * Object predicate is currently only used by vectorized matchers for non-string object selectors. This currently\n   * means it will be used only if we encounter COMPLEX types, but will also include array types once they are more\n   * supported throughout the query engines.\n   *\n   * To preserve behavior with non-vectorized matchers which use a string predicate with null inputs for these 'nil'\n   * matchers, we do the same thing here.\n   *\n   * @see org.apache.druid.segment.VectorColumnProcessorFactory#makeObjectProcessor\n   */\n  default DruidObjectPredicate<Object> makeObjectPredicate()\n  {\n    final DruidObjectPredicate<String> stringPredicate = makeStringPredicate();\n    return o -> stringPredicate.apply(null);\n  }\n}","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/filter/DruidPredicateFactory.java#L24-L60","documentation":"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.","triggerScenarios":"Applying a filter whose DruidPredicateFactory does not implement makeArrayPredicate to an ARRAY-typed column, e.g. via vectorized matching on array-valued dimensions.","commonSituations":"Filtering on ARRAY-typed columns with predicates/filters that only support scalar types; mixing older custom filters with new array column types.","solutions":["Use array-aware filters instead, e.g. the array_contains/array_overlap filters or an Expression filter over ARRAY_HAS/ARRAY_OVERLAP","Implement makeArrayPredicate() in the custom DruidPredicateFactory","Flatten arrays into separate rows or multi-value strings at ingestion if array filtering is not needed"],"exampleFix":"// before\nnew EqualityFilter(\"arrCol\", null, \"val\", null) // scalar predicate on array column\n// after\nexpressions.filter(DruidExpressions.fromExpressions(\"array_contains(\\\"arrCol\\\", 'val')\"))","handlingStrategy":"fallback","validationCode":"if (columnType.equals(ValueType.ARRAY) && !filter.supportsArrayPredicate()) {\n  filter = buildArrayExpressionFilter(filter); // use ARRAY_HAS/ARRAY_OVERLAP expressions\n}","typeGuard":"boolean arrayCapable = filter instanceof ExpressionFilter || filterSupportsArray(filter);","tryCatchPattern":"try {\n  return runVectorized(query);\n} catch (UOE e) {\n  if (e.getMessage().contains(\"does not support ARRAY\")) { return runNonVectorized(query); }\n  throw e;\n}","preventionTips":["Use array_contains/array_overlap expression filters for ARRAY columns","Check column type from the row signature before choosing a filter","Keep custom DruidPredicateFactory implementations updated with makeArrayPredicate"],"tags":["filter","array","vectorization"],"backgroundTag":"unsupported-operation","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"}