apache/druid · error · IllegalArgumentException
Column[%d] is not a valid column for segment[%s]
Error message
Column[%d] is not a valid column for segment[%s]
What it means
BroadcastSegmentIndexedTable.columnReader(int) validates the requested column index against the table's rowSignature. If the index is out of bounds (>= signature size or negative), Druid throws this IllegalArgumentException naming the segment, protecting downstream readers from selecting a nonexistent column.
Source
Thrown at processing/src/main/java/org/apache/druid/segment/join/table/BroadcastSegmentIndexedTable.java:194
}
@Override
public int numRows()
{
return queryableIndex.getNumRows();
}
@Override
public Index columnIndex(int column)
{
return RowBasedIndexedTable.getKeyColumnIndex(column, keyColumnsIndexes);
}
@Override
public Reader columnReader(int column)
{
if (!rowSignature.contains(column)) {
throw new IAE("Column[%d] is not a valid column for segment[%s]", column, segment.getId());
}
final SimpleAscendingOffset offset = new SimpleAscendingOffset(queryableIndex.getNumRows());
final BaseColumn baseColumn = queryableIndex.getColumnHolder(rowSignature.getColumnName(column)).getColumn();
final BaseObjectColumnValueSelector<?> selector = baseColumn.makeColumnValueSelector(offset);
return new Reader()
{
@Nullable
@Override
public Object read(int row)
{
offset.setCurrentOffset(row);
return selector.getObject();
}
@Override
public void close() throws IOException
{View on GitHub (pinned to 9b90983fd2)
Solutions
- Verify the column index against rowSignature.size() before calling columnReader
- Drop/rebuild the broadcast table or refresh cached joinables after schema changes so indexes match the current signature
- Ensure join clause column ordering matches the broadcast segment's rowSignature
Example fix
// before
reader = table.columnReader(3); // signature has 2 columns
// after
if (column < table.rowSignature().size()) { reader = table.columnReader(column); } Defensive patterns
Strategy: validation
Validate before calling
if (column < 0 || column >= table.rowSignature().size())
throw new IllegalArgumentException("column " + column + " out of range for broadcast table");
Reader r = table.columnReader(column); Try / catch
try { r = table.columnReader(col); } catch (IAE e) { log.error("stale join table signature for segment {}", e.getMessage()); refreshTable(); } Prevention
- Recompute join key indexes whenever a segment/table is reloaded
- Invalidate join caches after schema changes
- Compare the query's expected signature with rowSignature() before reading
When it happens
Trigger: Calling columnReader with an int column index not present in the table's RowSignature, usually from a join key/column mapping computed against a different signature version than the loaded segment.
Common situations: Segment replaced/updated so its signature no longer matches the query's expected column order; join cache keys built before a broker/server restart with a changed table schema; bugs in key column index computation for broadcast tables.
Related errors
- Column[%d] is not a valid column for the frame based datasou
- BroadcastTablesTooLarge
- Column[%s] does not start with prefix[%s]
- Detected duplicate prefix in join clauses: [%s]
- Detected conflicting prefixes in join clauses: [%s, %s]
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/65f85e785311c4bd.
Report an issue: GitHub.