prestodb/presto · error · PrestoException
HIVE_TIMEZONE_MISMATCH
HIVE_TIMEZONE_MISMATCH
Error message
To write Hive data, your JVM timezone must match the Hive storage timezone. Add -Duser.timezone=%s to your JVM arguments.
What it means
Write-path consistency check for legacy timestamp mode: the coordinator's JVM default timezone differs from the Hive storage timezone, which would corrupt timestamp values written with legacy semantics.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java:3549
ImmutableList.Builder<PartitionUpdate> result = ImmutableList.builder();
for (Slice fragment : fragments) {
byte[] bytes = fragment.getBytes();
PartitionUpdate partitionUpdate;
if (optimizedPartitionUpdateSerializationEnabled) {
partitionUpdate = deserializeZstdCompressed(partitionUpdateSmileCodec, bytes);
}
else {
partitionUpdate = partitionUpdateCodec.fromJson(bytes);
}
result.add(partitionUpdate);
}
return result.build();
}
private void verifyJvmTimeZone(ConnectorSession session)
{
if (session.getSqlFunctionProperties().isLegacyTimestamp() && !allowCorruptWritesForTesting && !timeZone.equals(DateTimeZone.getDefault())) {
throw new PrestoException(HIVE_TIMEZONE_MISMATCH, format(
"To write Hive data, your JVM timezone must match the Hive storage timezone. Add -Duser.timezone=%s to your JVM arguments.",
timeZone.getID()));
}
}
private static HiveStorageFormat extractHiveStorageFormat(Table table)
{
StorageFormat storageFormat = table.getStorage().getStorageFormat();
String outputFormat = storageFormat.getOutputFormat();
String serde = storageFormat.getSerDe();
for (HiveStorageFormat format : values()) {
if (format.getOutputFormat().equals(outputFormat) && format.getSerDe().equals(serde)) {
return format;
}
}
throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, format("Output format %s with SerDe %s is not supported", outputFormat, serde));
}View on GitHub (pinned to 55bb57d202)
Solutions
- Restart the JVM with -Duser.timezone=<hive-storage-timezone>
- Set the storage timezone property to match the JVM default
- Use non-legacy timestamp semantics if the data allows
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java:3549 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/cc9c36f6d9ccc0dd.
Report an issue: GitHub.