{"record":{"id":"f9cbf9bc78487bc8","repo":"prestodb/presto","slug":"generic-user-error-f9cbf9","errorCode":"GENERIC_USER_ERROR","errorMessage":"%s compression is not supported with %s","messagePattern":"(.+?) compression is not supported with (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveWritableTableHandle.java","lineNumber":73,"sourceCode":"            HiveStorageFormat actualStorageFormat,\n            HiveCompressionCodec compressionCodec,\n            Optional<EncryptionInformation> encryptionInformation)\n    {\n        this.schemaName = requireNonNull(schemaName, \"schemaName is null\");\n        this.tableName = requireNonNull(tableName, \"tableName is null\");\n        this.inputColumns = ImmutableList.copyOf(requireNonNull(inputColumns, \"inputColumns is null\"));\n        this.pageSinkMetadata = requireNonNull(pageSinkMetadata, \"pageSinkMetadata is null\");\n        this.locationHandle = requireNonNull(locationHandle, \"locationHandle is null\");\n        this.bucketProperty = requireNonNull(bucketProperty, \"bucketProperty is null\");\n        this.preferredOrderingColumns = requireNonNull(preferredOrderingColumns, \"preferredOrderingColumns is null\");\n        this.tableStorageFormat = requireNonNull(tableStorageFormat, \"tableStorageFormat is null\");\n        this.partitionStorageFormat = requireNonNull(partitionStorageFormat, \"partitionStorageFormat is null\");\n        this.actualStorageFormat = requireNonNull(actualStorageFormat, \"actualStorageFormat is null\");\n        this.compressionCodec = requireNonNull(compressionCodec, \"compressionCodec is null\");\n        this.encryptionInformation = requireNonNull(encryptionInformation, \"encryptionInformation is null\");\n\n        if (!compressionCodec.isSupportedStorageFormat(actualStorageFormat)) {\n            throw new PrestoException(GENERIC_USER_ERROR, String.format(\"%s compression is not supported with %s\", compressionCodec.name(), actualStorageFormat.name()));\n        }\n    }\n\n    @JsonProperty\n    public String getSchemaName()\n    {\n        return schemaName;\n    }\n\n    @JsonProperty\n    public String getTableName()\n    {\n        return tableName;\n    }\n\n    @JsonProperty\n    public List<HiveColumnHandle> getInputColumns()\n    {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveWritableTableHandle.java#L55-L91","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Change the compression codec (hive.compression-codec session property or catalog config) to one supported by the target storage format","Change the table's storage format to one that supports the desired codec (e.g. ORC/Parquet for ZSTD)","Explicitly set the session property: SET SESSION <catalog>.compression_codec = 'NONE' (or a supported codec)"],"exampleFix":"// before\nCREATE TABLE hive.default.t WITH (format='TEXTFILE') AS SELECT * FROM src; -- ZSTD codec set -> error\n// after\nSET SESSION hive.compression_codec = 'GZIP';\nCREATE TABLE hive.default.t WITH (format='TEXTFILE') AS SELECT * FROM src;","handlingStrategy":"validation","validationCode":"HiveStorageFormat fmt = HiveStorageFormat.ORC;\nHiveCompressionCodec codec = HiveCompressionCodec.ZSTD;\nif (!codec.isSupportedStorageFormat(fmt)) {\n    throw new IllegalArgumentException(codec + \" is not supported with \" + fmt);\n}","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(\"CREATE TABLE ... WITH (format='ORC')\");\n} catch (PrestoException e) {\n    if (GENERIC_USER_ERROR.equals(e.getErrorCode()) && e.getMessage().contains(\"compression is not supported\")) {\n        session.execute(\"SET SESSION hive.compression_codec = 'GZIP'\");\n    } else throw e;\n}","preventionTips":["Match hive.compression-codec to the table format before CTAS/INSERT","Prefer ORC/Parquet formats which support modern codecs (ZSTD, LZ4)","Document supported codec-format pairs for your cluster and validate DDL templates"],"tags":["hive","compression","storage-format","config"],"backgroundTag":"unsupported-compression-codec","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}