prestodb/presto · error · PrestoException
HIVE_UNSUPPORTED_FORMAT
HIVE_UNSUPPORTED_FORMAT
Error message
Missing SerDe for SymlinkTextInputFormat
What it means
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.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java:365
throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to find compressionCodec for inputFormat: " + inputFormat.getClass().getName(), e);
}
if (compressionCodecFactory == null) {
return Optional.empty();
}
return Optional.ofNullable(compressionCodecFactory.getCodec(file));
}
public static InputFormat<?, ?> getInputFormat(Configuration configuration, String inputFormatName, String serDe, boolean symlinkTarget)
{
try {
JobConf jobConf = toJobConf(configuration);
Class<? extends InputFormat<?, ?>> inputFormatClass = getInputFormatClass(jobConf, inputFormatName);
if (symlinkTarget && (inputFormatClass == SymlinkTextInputFormat.class)) {
if (serDe == null) {
throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, "Missing SerDe for SymlinkTextInputFormat");
}
/*
* https://github.com/apache/hive/blob/b240eb3266d4736424678d6c71c3c6f6a6fdbf38/ql/src/java/org/apache/hadoop/hive/ql/io/SymlinkTextInputFormat.java#L47-L52
* According to Hive implementation of SymlinkInputFormat, The target input data should be in TextInputFormat.
*
* But Delta Lake provides an integration with Presto using Symlink Tables with target input data as MapredParquetInputFormat.
* https://docs.delta.io/latest/presto-integration.html
*
* To comply with Hive implementation, we will keep the default value here as TextInputFormat unless serde is not LazySimpleSerDe
*/
if (serDe.equals(TEXTFILE.getSerDe())) {
inputFormatClass = TextInputFormat.class;
return ReflectionUtils.newInstance(inputFormatClass, jobConf);
}
for (HiveStorageFormat hiveStorageFormat : HiveStorageFormat.values()) {
if (serDe.equals(hiveStorageFormat.getSerDe())) {View on GitHub (pinned to 55bb57d202)
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
Example fix
-- before CREATE TABLE t (...) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat'; -- after CREATE TABLE t (...) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat' WITH SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';
Defensive patterns
Strategy: validation
Validate before calling
if ("org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat".equals(inputFormatName) && serDe == null) {
throw new IllegalArgumentException("SymlinkTextInputFormat requires an explicit SerDe");
} Type guard
boolean symlinkNeedsSerde(String inputFormatName) {
return "org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat".equals(inputFormatName);
} Try / catch
try { open(table); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.HIVE_UNSUPPORTED_FORMAT.getCode()) { /* repair serde metadata before retry */ } else throw e; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- HIVE_SERDE_NOT_FOUND
- HIVE_SERDE_NOT_FOUND
- HIVE_INVALID_METADATA
- GENERIC_INTERNAL_ERROR
- unsupported string field type:
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/35cabc7e55b3036e.
Report an issue: GitHub.