{"record":{"id":"7db688d572d4a79b","repo":"apache/druid","slug":"column-d-is-not-a-valid-column-for-the-frame-bas","errorCode":null,"errorMessage":"Column[%d] is not a valid column for the frame based datasource","messagePattern":"Column\\[(.+?)\\] is not a valid column for the frame based datasource","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/join/table/FrameBasedIndexedTable.java","lineNumber":216,"sourceCode":"  @Override\n  public int numRows()\n  {\n    return numRows;\n  }\n\n  @Override\n  public Index columnIndex(int column)\n  {\n    return RowBasedIndexedTable.getKeyColumnIndex(column, keyColumnsIndexes);\n\n  }\n\n  @Override\n  public Reader columnReader(int column)\n  {\n\n    if (!rowSignature.contains(column)) {\n      throw new IAE(\"Column[%d] is not a valid column for the frame based datasource\", column);\n    }\n\n    String columnName = rowSignature.getColumnName(column);\n    final SimpleAscendingOffset offset = new SimpleAscendingOffset(numRows());\n    final List<BaseObjectColumnValueSelector<?>> columnValueSelectors = new ArrayList<>();\n    final Set<Closeable> closeables = new HashSet<>();\n\n    for (QueryableIndex frameQueryableIndex : frameQueryableIndexes) {\n      BaseColumnHolder columnHolder = frameQueryableIndex.getColumnHolder(columnName);\n      if (columnHolder == null) {\n        columnValueSelectors.add(NilColumnValueSelector.instance());\n      } else {\n        BaseColumn baseColumn = columnHolder.getColumn();\n        columnValueSelectors.add(baseColumn.makeColumnValueSelector(offset));\n        closeables.add(baseColumn);\n      }\n    }\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/join/table/FrameBasedIndexedTable.java#L198-L234","documentation":"FrameBasedIndexedTable.columnReader(int) checks that the requested column index exists in the table's RowSignature before creating selectors over the frame-processor-backed datasource. An out-of-range index throws this IllegalArgumentException.","triggerScenarios":"Calling columnReader with an index >= rowSignature.size() (or negative) on a frame-based (dataframe-backed) indexed table, typically from join key/column mapping computed against a stale or different signature.","commonSituations":"Query planned against an older table signature than the loaded frame; join clause referencing more key columns than the frame datasource actually contains; schema evolution on the frame-based datasource.","solutions":["Validate the column index against the rowSignature before requesting a reader","Re-publish/reload the frame-based datasource so its signature matches the query plan","Fix the join clause/key mapping so column indexes stay within the table's actual column count"],"exampleFix":"// before\nReader r = frameTable.columnReader(5); // only 3 columns\n// after\nif (column >= 0 && column < frameTable.rowSignature().size()) {\n  Reader r = frameTable.columnReader(column);\n}","handlingStrategy":"validation","validationCode":"if (column < 0 || column >= rowSignature.size())\n  throw new IllegalArgumentException(\"column \" + column + \" out of range for frame datasource\");","typeGuard":null,"tryCatchPattern":"try { r = frameTable.columnReader(col); } catch (IAE e) { log.error(\"frame table column index {} invalid\", col); rebuildTable(); }","preventionTips":["Validate join column mappings against the frame's rowSignature at query planning time","Reload/rebuild the frame table after any schema change","Keep query plans and table signatures versioned together"],"tags":["java","join","frame","index","druid"],"backgroundTag":"index-out-of-range","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"}