{"record":{"id":"35cabc7e55b3036e","repo":"prestodb/presto","slug":"hive-unsupported-format-35cabc","errorCode":"HIVE_UNSUPPORTED_FORMAT","errorMessage":"Missing SerDe for SymlinkTextInputFormat","messagePattern":"Missing SerDe for SymlinkTextInputFormat","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java","lineNumber":365,"sourceCode":"            throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Failed to find compressionCodec for inputFormat: \" + inputFormat.getClass().getName(), e);\n        }\n\n        if (compressionCodecFactory == null) {\n            return Optional.empty();\n        }\n\n        return Optional.ofNullable(compressionCodecFactory.getCodec(file));\n    }\n\n    public static InputFormat<?, ?> getInputFormat(Configuration configuration, String inputFormatName, String serDe, boolean symlinkTarget)\n    {\n        try {\n            JobConf jobConf = toJobConf(configuration);\n\n            Class<? extends InputFormat<?, ?>> inputFormatClass = getInputFormatClass(jobConf, inputFormatName);\n            if (symlinkTarget && (inputFormatClass == SymlinkTextInputFormat.class)) {\n                if (serDe == null) {\n                    throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, \"Missing SerDe for SymlinkTextInputFormat\");\n                }\n\n                /*\n                 * https://github.com/apache/hive/blob/b240eb3266d4736424678d6c71c3c6f6a6fdbf38/ql/src/java/org/apache/hadoop/hive/ql/io/SymlinkTextInputFormat.java#L47-L52\n                 * According to Hive implementation of SymlinkInputFormat, The target input data should be in TextInputFormat.\n                 *\n                 * But Delta Lake provides an integration with Presto using Symlink Tables with target input data as MapredParquetInputFormat.\n                 * https://docs.delta.io/latest/presto-integration.html\n                 *\n                 * To comply with Hive implementation, we will keep the default value here as TextInputFormat unless serde is not LazySimpleSerDe\n                 */\n                if (serDe.equals(TEXTFILE.getSerDe())) {\n                    inputFormatClass = TextInputFormat.class;\n                    return ReflectionUtils.newInstance(inputFormatClass, jobConf);\n                }\n\n                for (HiveStorageFormat hiveStorageFormat : HiveStorageFormat.values()) {\n                    if (serDe.equals(hiveStorageFormat.getSerDe())) {","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java#L347-L383","documentation":"SymlinkTextInputFormat points to files listing target text files; to build the record reader the connector must know the SerDe of the underlying data. getInputFormat throws HIVE_UNSUPPORTED_FORMAT when a symlink-target split uses SymlinkTextInputFormat but no SerDe is available on the table/partition.","triggerScenarios":"Querying a table/partition with input format SymlinkTextInputFormat where serDe is null — e.g. table metadata missing the serde property, or a symlink-target read path constructed without the table's SerDe.","commonSituations":"Hand-crafted Hive tables with symlink input format but incomplete SerDe metadata; partitions created outside Hive with input format set but serde omitted; manifest-style symlink tables generated by external tools.","solutions":["Set the table/partition SerDe explicitly (e.g. STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat' WITH SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe')","Repair partition metadata with ALTER TABLE ... SET SERDE so the serde is present","Regenerate the symlink table using a tool that sets both input format and serde"],"exampleFix":"-- before\nCREATE TABLE t (...) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat';\n-- after\nCREATE TABLE t (...) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat' WITH SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';","handlingStrategy":"validation","validationCode":"if (\"org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat\".equals(inputFormatName) && serDe == null) {\n    throw new IllegalArgumentException(\"SymlinkTextInputFormat requires an explicit SerDe\");\n}","typeGuard":"boolean symlinkNeedsSerde(String inputFormatName) {\n    return \"org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat\".equals(inputFormatName);\n}","tryCatchPattern":"try { open(table); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.HIVE_UNSUPPORTED_FORMAT.getCode()) { /* repair serde metadata before retry */ } else throw e; }","preventionTips":["Always define WITH SERDE when creating SymlinkTextInputFormat tables","Audit partition metadata for missing serde properties after external table creation","Generate symlink manifests with tooling that sets both input format and serde"],"tags":["hive","serde","symlink","unsupported-format","metadata"],"backgroundTag":"missing-serde","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"}