apache/druid · error · org.apache.druid.java.util.common.RE

Failed to deserialize V

Error message

Failed to deserialize V%s column.

What it means

ScalarLongColumnAndIndexSupplier.read() wraps any IOException raised while deserializing a nested long column (dictionary, encoded values, or bitmaps) in this RuntimeException, attaching the column version. It means the on-disk bytes for the column could not be parsed — the file is truncated, corrupt, or was not written in the expected format.

Solutions

  1. Replace the corrupt segment with an intact replica (or re-download from deep storage)
  2. Re-ingest the affected time chunk to regenerate the segment
  3. Check historical/deep-storage disk health and available space; repair underlying storage issues
  4. If reproducible after a version change, re-serialize segments with the current Druid version
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check segment files before loading: sizes and readability of column part files
for (File part : segmentDir.listFiles()) {
  if (part.length() == 0 || !part.canRead()) {
    throw new IOException("Segment file incomplete/unreadable: " + part);
  }
}

Try / catch

try {
  ColumnHolder col = NestedDataColumnAndIndexSupplier.read(...);
  // use long column
} catch (RuntimeException e) {
  if (e.getCause() instanceof IOException) {
    LOG.error(e, "Corrupt long column in %s; falling back to replica/re-ingest", segmentId);
    segmentLoader.drop(segmentId);
    replicas.reroute(segmentId);
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: An IOException from reading the column part files: truncated/truncated-smooshed segment files, checksum mismatch, partially written segment from a crashed merge, or incompatible binary layout for the declared version.

Common situations: Disk corruption or incomplete segment replication on historicals; segments copied from deep storage mid-upload; running out of disk space during segment write leaving truncated files that are later read.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/segment/nested/ScalarLongColumnAndIndexSupplier.java:168

            columnBuilder.getFileMapper()
        );

        final Supplier<ColumnarLongs> longs = CompressedColumnarLongsSupplier.fromByteBuffer(
            longsValueColumn,
            byteOrder,
            columnBuilder.getFileMapper()
        );
        return new ScalarLongColumnAndIndexSupplier(
            longDictionarySupplier,
            encodedCol,
            longs,
            rBitmaps,
            bitmapSerdeFactory.getBitmapFactory(),
            columnConfig
        );
      }
      catch (IOException ex) {
        throw new RE(ex, "Failed to deserialize V%s column.", version);
      }
    } else {
      throw new RE("Unknown version " + version);
    }
  }

  private final Supplier<FixedIndexed<Long>> longDictionarySupplier;

  private final Supplier<ColumnarInts> encodedValuesSupplier;
  private final Supplier<ColumnarLongs> valueColumnSupplier;

  private final GenericIndexed<ImmutableBitmap> valueIndexes;

  private final BitmapFactory bitmapFactory;

  private final ImmutableBitmap nullValueBitmap;
  private final ColumnConfig columnConfig;

View on GitHub (pinned to 9b90983fd2)