{"record":{"id":"eec34c8c9ca39c3b","repo":"apache/druid","slug":"column-s-is-not-a-multi-value-string-column-do","errorCode":null,"errorMessage":"Column[%s] is not a multi-value string column, do not ask for a multi-value selector","messagePattern":"Column\\[(.+?)\\] is not a multi-value string column, do not ask for a multi-value selector","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/vector/QueryableIndexVectorColumnSelectorFactory.java","lineNumber":94,"sourceCode":"  }\n\n  @Override\n  public MultiValueDimensionVectorSelector makeMultiValueDimensionSelector(final DimensionSpec dimensionSpec)\n  {\n    if (!dimensionSpec.canVectorize()) {\n      throw new ISE(\"DimensionSpec[%s] cannot be vectorized\", dimensionSpec);\n    }\n    Function<DimensionSpec, MultiValueDimensionVectorSelector> mappingFunction = spec -> {\n      if (virtualColumns.exists(spec.getDimension())) {\n        return virtualColumns.makeMultiValueDimensionVectorSelector(dimensionSpec, this, columnSelector, offset);\n      }\n\n      final ColumnHolder holder = columnSelector.getColumnHolder(spec.getDimension());\n      if (holder == null\n          || holder.getCapabilities().isDictionaryEncoded().isFalse()\n          || !holder.getCapabilities().is(ValueType.STRING)\n          || holder.getCapabilities().hasMultipleValues().isFalse()) {\n        throw new ISE(\n            \"Column[%s] is not a multi-value string column, do not ask for a multi-value selector\",\n            spec.getDimension()\n        );\n      }\n\n      @SuppressWarnings(\"unchecked\")\n      final DictionaryEncodedColumn<String> dictionaryEncodedColumn =\n          (DictionaryEncodedColumn<String>) holder.getColumn();\n\n      // dictionaryEncodedColumn is not null because of holder null check above\n      assert dictionaryEncodedColumn != null;\n      final MultiValueDimensionVectorSelector selector = dictionaryEncodedColumn.makeMultiValueDimensionVectorSelector(\n          offset\n      );\n\n      return spec.decorate(selector);\n    };\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/vector/QueryableIndexVectorColumnSelectorFactory.java#L76-L112","documentation":"A multi-value dimension vector selector can only be built on a column that actually exists and is a dictionary-encoded multi-value STRING column. When the requested column is missing, not string-typed, or single-valued, the factory throws this ISE to catch planning bugs where the vector engine asked for the wrong selector kind.","triggerScenarios":"Vectorized query calls makeMultiValueDimensionSelector on a single-value string/long column, a non-existent column, or a non-dictionary-encoded column.","commonSituations":"Auto-detected column type changed between segments (some segments string MV, others long) causing one segment to fail; planning code assuming multi-value based on ingest-time schema; typo'd column name.","solutions":["Confirm the column is ingested as multi-value string (use_json_string_array / MV ingestion) and exists in the segment","Use a single-value selector/query path for single-valued columns, or use ARRAY functions for typed arrays","Check the segment schema (segment metadata query) for actual column type; re-ingest if types diverge","Disable vectorization ('vectorize':'false') as a workaround while fixing the spec"],"exampleFix":"// before\nfactory.makeMultiValueDimensionSelector(DefaultDimensionSpec.of(\"singleValuedCol\"));\n// after\nfactory.makeSingleValueDimensionSelector(DefaultDimensionSpec.of(\"singleValuedCol\"));","handlingStrategy":"validation","validationCode":"// check segment metadata first\nColumnIngestionPermits/dataset: run segment metadata query and verify capabilities:\nboolean ok = holder != null && holder.getCapabilities().isDictionaryEncoded().isMaybeTrue()\n          && holder.getCapabilities().is(ValueType.STRING)\n          && holder.getCapabilities().hasMultipleValues().isMaybeTrue();","typeGuard":"boolean isMvString = caps.is(ValueType.STRING) && caps.hasMultipleValues().isMaybeTrue();","tryCatchPattern":"try { sel = factory.makeMultiValueDimensionSelector(spec); } catch (IllegalStateException e) { sel = factory.makeSingleValueDimensionSelector(spec); }","preventionTips":["Enforce consistent column types with an explicit dimensionsSpec at ingest","Run a segment metadata query to confirm column types before MV-specific queries","Use ARRAY-typed columns and ARRAY functions for typed arrays instead of MV strings"],"tags":["vectorization","multi-value","column-type","selector"],"backgroundTag":"incompatible-source-type","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"}