{"record":{"id":"501bf56a908fc65f","repo":"prestodb/presto","slug":"hive-unsupported-format-501bf5","errorCode":"HIVE_UNSUPPORTED_FORMAT","errorMessage":"Failed to load compression codec: ","messagePattern":"Failed to load compression codec: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java","lineNumber":692,"sourceCode":"        return OptionalInt.empty();\n    }\n\n    public static String getFileExtension(StorageFormat storageFormat, HiveCompressionCodec compressionCodec)\n    {\n        // text format files must have the correct extension when compressed\n        if (compressionCodec == NONE || !HiveIgnoreKeyTextOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) {\n            return \"\";\n        }\n\n        if (!compressionCodec.getCodec().isPresent()) {\n            return new DefaultCodec().getDefaultExtension();\n        }\n\n        try {\n            return compressionCodec.getCodec().get().getConstructor().newInstance().getDefaultExtension();\n        }\n        catch (ReflectiveOperationException e) {\n            throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, \"Failed to load compression codec: \" + compressionCodec.getCodec().get(), e);\n        }\n    }\n\n    private static Properties createHiveSchema(List<DataColumn> dataColumns)\n    {\n        Properties schema = new Properties();\n        schema.setProperty(META_TABLE_COLUMNS, dataColumns.stream()\n                .map(DataColumn::getName)\n                .collect(joining(\",\")));\n        schema.setProperty(META_TABLE_COLUMN_TYPES, dataColumns.stream()\n                .map(DataColumn::getHiveType)\n                .map(HiveType::getHiveTypeName)\n                .map(HiveTypeName::toString)\n                .collect(joining(\":\")));\n        return schema;\n    }\n\n    private static void checkPartitionSchemeSameAsTableScheme(","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java#L674-L710","documentation":"getFileExtension loads the compression codec's extension via reflection/codec creation; a RuntimeException there (codec class missing or not instantiable) is wrapped in this error — the configured Hive compression codec cannot be loaded.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java:692 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the compression codec class is on the classpath","Switch to a supported compression codec setting","Check the nested exception for classloading details"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}