prestodb/presto · error · OrcCorruptionException
Unexpected metadata
Error message
Unexpected metadata
What it means
Write-validation error in OrcWriteValidation.validateMetadata: when re-reading a file written under validation, the user metadata stored in the file differs from what the writer recorded. This is a corruption/bug detector — the file on disk does not match what the writer produced.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:202
}
public Map<String, Slice> getMetadata()
{
return metadata;
}
public void validateMetadata(OrcDataSourceId orcDataSourceId, Map<String, Slice> actualMetadata)
throws OrcCorruptionException
{
if (isDwrf()) {
// Filter out metadata value statically added by the DWRF writer
actualMetadata = actualMetadata.entrySet().stream()
.filter(entry -> !STATIC_METADATA.containsKey(entry.getKey()))
.collect(toImmutableMap(Entry::getKey, Entry::getValue));
}
if (!metadata.equals(actualMetadata)) {
throw new OrcCorruptionException(orcDataSourceId, "Unexpected metadata");
}
}
public OrcEncoding getOrcEncoding()
{
return orcEncoding;
}
public boolean isDwrf()
{
return orcEncoding == DWRF;
}
public ZoneId getTimezone()
{
return timezone;
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Re-run the write job with a fresh output file
- Report as a Presto ORC writer bug if reproducible with validation enabled
- Disable write validation only as a diagnostic, not a fix
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:202 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/d6d7c51f251a471c.
Report an issue: GitHub.