apache/druid · error · UnsupportedOperationException
NONE compression strategy shouldn't use any compressor
Error message
NONE compression strategy shouldn't use any compressor
What it means
The NONE CompressionStrategy stores data uncompressed, so it has no Compressor; getCompressor() throws UnsupportedOperationException. Writers must special-case NONE (or use UNCOMPRESSED, which supplies a no-op compressor) rather than requesting a compressor from it.
Source
Thrown at processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java:122
return UncompressedCompressor.DEFAULT_COMPRESSOR;
}
},
/**
* This value indicate no compression strategy should be used, and compression should not be block based.
* {@link ColumnarLongs}, {@link ColumnarFloats} and {@link ColumnarDoubles} support non block based compression, and
* other types treat this as {@link #UNCOMPRESSED}.
*/
NONE((byte) 0xFE) {
@Override
public Decompressor getDecompressor()
{
throw new UnsupportedOperationException("NONE compression strategy shouldn't use any decompressor");
}
@Override
public Compressor getCompressor()
{
throw new UnsupportedOperationException("NONE compression strategy shouldn't use any compressor");
}
};
private static final Logger LOG = new Logger(CompressionStrategy.class);
public static final CompressionStrategy DEFAULT_COMPRESSION_STRATEGY = LZ4;
final byte id;
CompressionStrategy(byte id)
{
this.id = id;
}
public byte getId()
{
return id;
}
View on GitHub (pinned to 9b90983fd2)
Solutions
- Use CompressionStrategy.UNCOMPRESSED instead of NONE when a no-op compressor is needed
- Check strategy == CompressionStrategy.NONE before calling getCompressor() and skip compression entirely
- Change the ingestion spec compression to LZ4/ZSTD if compression is expected
Example fix
// before
Compressor c = strategy.getCompressor();
// after
Compressor c = (strategy == CompressionStrategy.NONE)
? CompressionStrategy.UNCOMPRESSED.getCompressor()
: strategy.getCompressor(); Defensive patterns
Strategy: type-guard
Validate before calling
if (strategy == CompressionStrategy.NONE) { writeUncompressed(); } else { compress(); } Type guard
if (strategy != CompressionStrategy.NONE) { Compressor c = strategy.getCompressor(); ... } Try / catch
try {
c = strategy.getCompressor();
} catch (UnsupportedOperationException e) {
c = CompressionStrategy.UNCOMPRESSED.getCompressor();
} Prevention
- Prefer UNCOMPRESSED (no-op compressor) over NONE for writers
- Special-case NONE before compressor acquisition
- Set spec compression to a real strategy when compression is intended
When it happens
Trigger: Calling getCompressor() on CompressionStrategy.NONE, typically from a segment writer using a generic compression path while the config selects compression strategy NONE.
Common situations: Ingestion specs with compression: "none" flowing through code that unconditionally fetches a compressor; mixing NONE into APIs expecting a real compressor.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- NONE compression strategy shouldn't use any decompressor
- Directory compression not supported for %s
- Directory decompression not supported for %s
- Reverse lookup not allowed.
- Serialization not supported here
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/c3821fac5411e879.
Report an issue: GitHub.