{"record":{"id":"47f7d2820b90fea9","repo":"apache/druid","slug":"multi-value-row-not-supported","errorCode":null,"errorMessage":"Multi-value row not supported","messagePattern":"Multi-value row not supported","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java","lineNumber":154,"sourceCode":"    return column.size();\n  }\n\n  @Override\n  public boolean hasMultipleValues()\n  {\n    return false;\n  }\n\n  @Override\n  public int getSingleValueRow(int rowNum)\n  {\n    return column.get(rowNum);\n  }\n\n  @Override\n  public IndexedInts getMultiValueRow(int rowNum)\n  {\n    throw new IllegalStateException(\"Multi-value row not supported\");\n  }\n\n  @Nullable\n  @Override\n  public String lookupName(int id)\n  {\n    final int globalId = dictionary.get(id);\n    if (globalId < adjustLongId) {\n      return StringUtils.fromUtf8Nullable(globalDictionary.get(globalId));\n    } else if (globalId < adjustDoubleId) {\n      return String.valueOf(globalLongDictionary.get(globalId - adjustLongId));\n    } else if (globalId < adjustArrayId) {\n      return String.valueOf(globalDoubleDictionary.get(globalId - adjustDoubleId));\n    }\n    return null;\n  }\n\n  public Object lookupObject(int id)","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/nested/NestedFieldDictionaryEncodedColumn.java#L136-L172","documentation":"NestedFieldDictionaryEncodedColumn represents a single scalar nested field, so its vector/single-value accessors assume one value per row. getMultiValueRow() is an unsupported operation for this column type and always throws IllegalStateException: the column cannot hold multi-value rows.","triggerScenarios":"A query engine or accessor calls getMultiValueRow(int) on a NestedFieldDictionaryEncodedColumn, e.g. generic column-accessor code treating the nested field column as a multi-value capable column.","commonSituations":"Engine code paths written for ARRAY/multi-value columns invoked on scalar nested fields; custom extensions iterating columns via the multi-value API; mis-typed column inference treating a scalar field as an array.","solutions":["Check the column's capabilities (hasMultipleValues/getCardinality/type) before calling getMultiValueRow; use getRow()/get(r) for scalar columns.","Fix type inference or the query path so multi-value APIs are only used on ARRAY-typed columns.","If the field should be multi-valued, re-ingest with the field actually containing arrays so the correct column type is created."],"exampleFix":"// before\nIndexedInts vals = column.getMultiValueRow(rowNum);\n// after\nif (column instanceof NestedFieldDictionaryEncodedColumn) {\n  Object v = ((NestedFieldDictionaryEncodedColumn) column).get(rowNum); // scalar path\n} else {\n  IndexedInts vals = column.getMultiValueRow(rowNum);\n}","handlingStrategy":"type-guard","validationCode":"// consult column capabilities before choosing the accessor API\nboolean multiValue = columnType.isArray() || metadata.hasMultipleValues.get();\nIndexedInts vals = multiValue ? column.getMultiValueRow(row) : null;","typeGuard":"boolean supportsMultiValueRows(BaseColumn col) {\n  return !(col instanceof NestedFieldDictionaryEncodedColumn);\n}","tryCatchPattern":"try {\n  vals = col.getMultiValueRow(row);\n} catch (IllegalStateException e) {\n  if (e.getMessage().equals(\"Multi-value row not supported\")) {\n    vals = null; // fall back to scalar get(row)\n  } throw e;\n}","preventionTips":["Check ColumnType/capabilities before calling multi-value APIs","Only use getMultiValueRow on ARRAY-typed columns","Add instanceof checks for NestedFieldDictionaryEncodedColumn in generic accessor code"],"tags":["druid","nested-column","unsupported-operation","multi-value"],"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"}