prestodb/presto · error · PrestoException

GENERIC_USER_ERROR

GENERIC_USER_ERROR

Error message

%s compression is not supported with %s

What it means

HiveWriteUtils/HiveWritableTableHandle validates that the chosen compression codec is compatible with the target table's actual storage format before any data is written. The codec's isSupportedStorageFormat check failed, so Presto aborts at table-handle construction time rather than failing mid-write. This is a static configuration mismatch, not a runtime I/O problem.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWritableTableHandle.java:73

            HiveStorageFormat actualStorageFormat,
            HiveCompressionCodec compressionCodec,
            Optional<EncryptionInformation> encryptionInformation)
    {
        this.schemaName = requireNonNull(schemaName, "schemaName is null");
        this.tableName = requireNonNull(tableName, "tableName is null");
        this.inputColumns = ImmutableList.copyOf(requireNonNull(inputColumns, "inputColumns is null"));
        this.pageSinkMetadata = requireNonNull(pageSinkMetadata, "pageSinkMetadata is null");
        this.locationHandle = requireNonNull(locationHandle, "locationHandle is null");
        this.bucketProperty = requireNonNull(bucketProperty, "bucketProperty is null");
        this.preferredOrderingColumns = requireNonNull(preferredOrderingColumns, "preferredOrderingColumns is null");
        this.tableStorageFormat = requireNonNull(tableStorageFormat, "tableStorageFormat is null");
        this.partitionStorageFormat = requireNonNull(partitionStorageFormat, "partitionStorageFormat is null");
        this.actualStorageFormat = requireNonNull(actualStorageFormat, "actualStorageFormat is null");
        this.compressionCodec = requireNonNull(compressionCodec, "compressionCodec is null");
        this.encryptionInformation = requireNonNull(encryptionInformation, "encryptionInformation is null");

        if (!compressionCodec.isSupportedStorageFormat(actualStorageFormat)) {
            throw new PrestoException(GENERIC_USER_ERROR, String.format("%s compression is not supported with %s", compressionCodec.name(), actualStorageFormat.name()));
        }
    }

    @JsonProperty
    public String getSchemaName()
    {
        return schemaName;
    }

    @JsonProperty
    public String getTableName()
    {
        return tableName;
    }

    @JsonProperty
    public List<HiveColumnHandle> getInputColumns()
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Change the compression codec (hive.compression-codec session property or catalog config) to one supported by the target storage format
  2. Change the table's storage format to one that supports the desired codec (e.g. ORC/Parquet for ZSTD)
  3. Explicitly set the session property: SET SESSION <catalog>.compression_codec = 'NONE' (or a supported codec)

Example fix

// before
CREATE TABLE hive.default.t WITH (format='TEXTFILE') AS SELECT * FROM src; -- ZSTD codec set -> error
// after
SET SESSION hive.compression_codec = 'GZIP';
CREATE TABLE hive.default.t WITH (format='TEXTFILE') AS SELECT * FROM src;
Defensive patterns

Strategy: validation

Validate before calling

HiveStorageFormat fmt = HiveStorageFormat.ORC;
HiveCompressionCodec codec = HiveCompressionCodec.ZSTD;
if (!codec.isSupportedStorageFormat(fmt)) {
    throw new IllegalArgumentException(codec + " is not supported with " + fmt);
}

Try / catch

try {
    session.execute("CREATE TABLE ... WITH (format='ORC')");
} catch (PrestoException e) {
    if (GENERIC_USER_ERROR.equals(e.getErrorCode()) && e.getMessage().contains("compression is not supported")) {
        session.execute("SET SESSION hive.compression_codec = 'GZIP'");
    } else throw e;
}

Prevention

When it happens

Trigger: Creating or inserting into a Hive table where the session/system compression codec (e.g. ZSTD, LZ4, GZIP) is not on the allowed list for the table's storage format (e.g. ORC with GZIP, or a text format with ZSTD).

Common situations: Setting hive.compression-codec to a codec newer than the target format supports; creating an ORC/Parquet/TextFile table with an incompatible default codec; copying DDL between clusters with different codec defaults.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/f9cbf9bc78487bc8. Report an issue: GitHub.