prestodb/presto · error · PrestoException

HIVE_SERDE_NOT_FOUND

HIVE_SERDE_NOT_FOUND

Error message

deserializer does not exist: %s

What it means

getDeserializerClass loads the SerDe class named in table/partition metadata via Class.forName restricted to Deserializer subclasses; if the class is not found it throws HIVE_SERDE_NOT_FOUND. The table/partition references a serde that is not on the connector's classpath.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java:575

        return deserializer;
    }

    private static Class<? extends Deserializer> getDeserializerClass(String name)
    {
        // CDH uses different names for Parquet
        if ("parquet.hive.serde.ParquetHiveSerDe".equals(name)) {
            return ParquetHiveSerDe.class;
        }

        if ("org.apache.hadoop.hive.serde2.avro.AvroSerDe".equals(name)) {
            return AvroSerDe.class;
        }

        try {
            return Class.forName(name, true, JavaUtils.getClassLoader()).asSubclass(Deserializer.class);
        }
        catch (ClassNotFoundException e) {
            throw new PrestoException(HIVE_SERDE_NOT_FOUND, "deserializer does not exist: " + name);
        }
        catch (ClassCastException e) {
            throw new RuntimeException("invalid deserializer class: " + name);
        }
    }

    private static Deserializer createDeserializer(Class<? extends Deserializer> clazz)
    {
        try {
            return clazz.getConstructor().newInstance();
        }
        catch (ReflectiveOperationException e) {
            throw new RuntimeException("error creating deserializer: " + clazz.getName(), e);
        }
    }

    private static void initializeDeserializer(Configuration configuration, Deserializer deserializer, Properties schema)
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Fix the serde class name in table/partition metadata (ALTER TABLE ... SET SERDE)
  2. Deploy the serde's jar to the Hive connector plugin classpath and restart Presto
  3. Switch the table to a serde bundled with the connector (e.g. LazySimpleSerDe, OrcSerde, ParquetHiveSerDe)

Example fix

-- before
ALTER TABLE t SET SERDE 'com.example.MySerDe';
-- after
ALTER TABLE t SET SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';
Defensive patterns

Strategy: validation

Validate before calling

try {
    Class.forName(serdeName, false, getClass().getClassLoader()).asSubclass(org.apache.hadoop.hive.serde2.Deserializer.class);
} catch (ClassNotFoundException e) {
    throw new IllegalArgumentException("serde not on classpath: " + serdeName, e);
}

Type guard

boolean serdeAvailable(String name) {
    try { Class.forName(name, false, Thread.currentThread().getContextClassLoader()); return true; }
    catch (ClassNotFoundException e) { return false; }
}

Try / catch

try { query(table); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.HIVE_SERDE_NOT_FOUND.getCode()) { /* deploy serde jar or ALTER TABLE SET SERDE to a bundled one */ } else throw e; }

Prevention

When it happens

Trigger: Table/partition serde property (e.g. 'org.apache.hadoop.hive.serde2.SomeSerDe') that is misspelled, from a Hive release/custom plugin not present in Presto's classpath, or removed in a version upgrade.

Common situations: Custom serde jars not deployed to the Hive connector plugin directory; referencing serde classes available in Hive but not bundled with the connector; partition metadata copied from another cluster with different plugins.

Related errors


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