apache/druid · error · IllegalStateException

Can't find field [ ] with name [ ] in [ ] file.

Error message

Can't find field [%s] with name [%s] in [%s] file.

What it means

During construction, CompressedNestedDataComplexColumn maps each nested field's data file via fileMapper.mapFile(fieldFileName); if the memory mapper returns null the field's backing file is missing and it throws ISE. This means the column's metadata references a field file that is not present in the segment.

Solutions

  1. Re-download the segment — its nested field files are incomplete
  2. Verify the Druid version reading matches the version that wrote the nested column
  3. Check that all *field* files referenced by the column's metadata exist in the segment dir
  4. Re-ingest the segment if source files are corrupt

Example fix

// before
ByteBuffer buf = fileMapper.mapFile(fieldFileName); // null -> ISE
// after
if (fileMapper.mapFile(fieldFileName) == null) { redownloadSegment(columnName); }
Defensive patterns

Strategy: validation

Validate before calling

ByteBuffer buf = fileMapper.mapFile(fieldFileName); if (buf == null) { refetchSegment(); } // verify all expected field files before use

Type guard

boolean hasFieldFile(SegmentFileMapper mapper, String name) { return mapper.mapFile(name) != null; }

Try / catch

try { col = new CompressedNestedDataComplexColumn(...); } catch (ISE e) { log.error(e, "Missing nested field file in %s", columnName); cacheCleaner.cleanup(segmentDir); throw e; }

Prevention

When it happens

Trigger: Building the column when getFieldFileName produces a name that mapFile cannot resolve — missing/corrupt field data file in the segment, or metadata/file naming mismatch between writer and reader versions.

Common situations: Partial segment download/truncated cache; segments written by an older Druid version with different field file naming; corrupted deep storage objects.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/77116e6b0120b6a8. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:1092

  }

  private BaseColumnHolder getColumnHolder(String field, int fieldIndex)
  {
    return columns.computeIfAbsent(fieldIndex, (f) -> readNestedFieldColumn(field, fieldIndex));
  }

  @Nullable
  private BaseColumnHolder readNestedFieldColumn(String field, int fieldIndex)
  {
    try {
      if (fieldIndex < 0) {
        return null;
      }
      final FieldTypeInfo.TypeSet types = fieldInfo.getTypes(fieldIndex);
      final String fieldFileName = getFieldFileName(columnName, field, fieldIndex);
      final ByteBuffer dataBuffer = fileMapper.mapFile(fieldFileName);
      if (dataBuffer == null) {
        throw new ISE(
            "Can't find field [%s] with name [%s] in [%s] file.",
            field,
            fieldFileName,
            columnName
        );
      }

      ColumnBuilder columnBuilder = new ColumnBuilder().setFileMapper(fileMapper);
      // heh, maybe this should be its own class, or DictionaryEncodedColumnPartSerde could be cooler
      DictionaryEncodedColumnPartSerde.VERSION version = DictionaryEncodedColumnPartSerde.VERSION.fromByte(
          dataBuffer.get()
      );
      // we should check this someday soon, but for now just read it to push the buffer position ahead
      int flags = dataBuffer.getInt();
      if (flags != DictionaryEncodedColumnPartSerde.NO_FLAGS) {
        throw DruidException.defensive(
            "Unrecognized bits set in space reserved for future flags for field column [%s]", field
        );

View on GitHub (pinned to 9b90983fd2)