{"record":{"id":"ccab89fa83e7c189","repo":"prestodb/presto","slug":"hive-serde-not-found-ccab89","errorCode":"HIVE_SERDE_NOT_FOUND","errorMessage":"Serializer does not exist: ","messagePattern":"Serializer does not exist: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java","lineNumber":304,"sourceCode":"                            throws IOException\n            {\n                writer.close();\n                if (!abort) {\n                    length = target.getFileSystem(conf).getFileStatus(target).getLen();\n                }\n            }\n        };\n    }\n\n    public static Serializer initializeSerializer(Configuration conf, Properties properties, String serializerName)\n    {\n        try {\n            Serializer result = (Serializer) Class.forName(serializerName).getConstructor().newInstance();\n            ((AbstractSerDe) result).initialize(conf, properties, null);\n            return result;\n        }\n        catch (ClassNotFoundException e) {\n            throw new PrestoException(HIVE_SERDE_NOT_FOUND, \"Serializer does not exist: \" + serializerName);\n        }\n        catch (SerDeException | ReflectiveOperationException e) {\n            throw new PrestoException(HIVE_WRITER_DATA_ERROR, e);\n        }\n    }\n\n    public static ObjectInspector getJavaObjectInspector(Type type)\n    {\n        if (type.equals(BooleanType.BOOLEAN)) {\n            return javaBooleanObjectInspector;\n        }\n        else if (type.equals(BigintType.BIGINT)) {\n            return javaLongObjectInspector;\n        }\n        else if (type.equals(IntegerType.INTEGER)) {\n            return javaIntObjectInspector;\n        }\n        else if (type.equals(SmallintType.SMALLINT)) {","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java#L286-L322","documentation":"When writing to a Hive table, Presto instantiates the SerDe class named in the table metadata via reflection. ClassNotFoundException means the class named by the table's serde_lib property does not exist on Presto's classpath, so no Serializer can be created. Other reflective failures are reported as HIVE_WRITER_DATA_ERROR instead.","triggerScenarios":"INSERT or CREATE TABLE AS into a Hive table whose SerDe fully-qualified class name (from the metastore's SDS.SERDE_LIB) cannot be loaded by Class.forName in the Presto JVM.","commonSituations":"Tables created with third-party or custom SerDes not deployed to Presto workers; metastore metadata pointing at a SerDe removed in newer Hive versions (e.g. old LazySimpleSerDe package names); typo in SERDE_LIB stored in the metastore.","solutions":["Install the missing SerDe JAR into the plugin/hive/ directory on every Presto worker and restart","Alter the table to use a built-in SerDe matching the storage format (e.g. org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe)","Check the metastore (DESCRIBE FORMATTED / SDS table) for a wrong or outdated serde_lib value and correct it"],"exampleFix":"// before (table metadata)\nSERDE 'com.example.CustomSerDe' -- not on Presto classpath\n// after\nALTER TABLE t SET SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';","handlingStrategy":"validation","validationCode":"String serdeName = table.getSerdeLib(); // from DESCRIBE FORMATTED / metastore\nboolean available;\ntry { Class.forName(serdeName); available = true; } catch (ClassNotFoundException e) { available = false; }\nif (!available) throw new IllegalStateException(\"SerDe missing on Presto classpath: \" + serdeName);","typeGuard":null,"tryCatchPattern":"try {\n    insertInto(table);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == HIVE_SERDE_NOT_FOUND.toErrorCode()) {\n        // deploy the SerDe jar to plugin/hive/ or rewrite the table with a built-in SerDe\n    } else throw e;\n}","preventionTips":["Only use SerDes bundled with Presto's hive plugin for Presto-written tables","Keep custom SerDe jars synced on every worker under plugin/hive/","Audit metastore serde_lib values after Hive upgrades"],"tags":["hive","serde","classpath","metadata"],"backgroundTag":"serde-class-not-found","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"}