{"record":{"id":"0a641a152ca18255","repo":"prestodb/presto","slug":"hive-unsupported-format-0a641a","errorCode":"HIVE_UNSUPPORTED_FORMAT","errorMessage":"Unknown %s compression type %s","messagePattern":"Unknown (.+?) compression type (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/OrcFileWriterFactory.java","lineNumber":387,"sourceCode":"    public DataSink createDataSink(ConnectorSession session, FileSystem fileSystem, Path path)\n            throws IOException\n    {\n        return dataSinkFactory.createDataSink(session, fileSystem, path);\n    }\n\n    private static CompressionKind getCompression(Properties schema, JobConf configuration, OrcEncoding orcEncoding)\n    {\n        String compressionName = OrcConf.COMPRESS.getString(schema, configuration);\n        if (compressionName == null) {\n            return CompressionKind.ZLIB;\n        }\n\n        CompressionKind compression;\n        try {\n            compression = CompressionKind.valueOf(compressionName.toUpperCase(ENGLISH));\n        }\n        catch (IllegalArgumentException e) {\n            throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, \"Unknown \" + orcEncoding + \" compression type \" + compressionName);\n        }\n        return compression;\n    }\n\n    private Set<Integer> getFlattenedColumns(Properties schema, ConnectorSession session)\n    {\n        boolean flatMapsEnabled = parseBoolean(schema.getProperty(ORC_FLAT_MAP_WRITER_ENABLED_KEY, \"false\"));\n        ImmutableSet.Builder<Integer> flattenedColumnsBuilder = ImmutableSet.builder();\n        if (flatMapsEnabled) {\n            String columnsValue = schema.getProperty(ORC_FLAT_MAP_COLUMN_NUMBERS_KEY, \"\");\n            FLAT_MAP_COLUMN_NUMBERS_SPLITTER.splitToList(columnsValue).stream()\n                    .map(Integer::valueOf)\n                    .forEach(flattenedColumnsBuilder::add);\n        }\n        Set<Integer> flattenedColumns = flattenedColumnsBuilder.build();\n\n        // fail if flat maps are enabled for the table, but flat map writer is not enabled in the session\n        boolean flatMapWriterEnabled = isFlatMapWriterEnabled(session);","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/OrcFileWriterFactory.java#L369-L405","documentation":"When writing a Hive table in ORC format, Presto maps the table's compression property name to an org.apache.orc.CompressionKind enum via valueOf. If the configured compression name is not one of the enum's constants (NONE, ZLIB, SNAPPY, LZO, LZ4, ZSTD), the ORC writer factory throws HIVE_UNSUPPORTED_FORMAT. It means the compression setting on the table/session is not a codec the ORC writer recognizes.","triggerScenarios":"Creating or inserting into a Hive table whose compression codec property is set to a string that does not exactly match (case-insensitively) a CompressionKind constant, e.g. 'gzip', 'brotli', or a misspelled/whitespace-padded value.","commonSituations":"Table definitions copied from other engines that allow codecs ORC does not; typos or trailing spaces in compression config; using a newer codec (e.g. ZSTD) on an older Presto build whose ORC enum lacks it; provisioning tools writing odd compression values into table properties.","solutions":["Change the table/session compression to a supported ORC codec: NONE, ZLIB, SNAPPY, LZO, LZ4, or ZSTD (build-dependent).","Check for typos, trailing spaces, or wrong case in the compression property value.","If a newer codec is required, upgrade Presto to a version whose bundled ORC supports it.","If compression came from a session property, correct it with SET SESSION hive.compression_codec = 'ZLIB';"],"exampleFix":"// before (table property)\nWITH (format='ORC', compression='GZIP')\n// after\nWITH (format='ORC', compression='ZLIB')","handlingStrategy":"validation","validationCode":"import org.apache.orc.CompressionKind;\nimport java.util.Locale;\nboolean isSupportedOrcCompression(String name) {\n    if (name == null) return false;\n    try { CompressionKind.valueOf(name.trim().toUpperCase(Locale.ROOT)); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","typeGuard":"boolean isValidCompressionKind(String name) {\n    return java.util.Arrays.stream(CompressionKind.values())\n        .anyMatch(k -> k.name().equalsIgnoreCase(name));\n}","tryCatchPattern":null,"preventionTips":["Only use ORC enum codecs (ZLIB, SNAPPY, ZSTD, NONE...) in table properties and session settings.","Validate compression values in provisioning/DDL tooling before applying them to tables.","Keep Presto/ORC versions consistent with any newer codec you intend to use."],"tags":["hive","orc","configuration","unsupported-compression"],"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"}