prestodb/presto · error · SQLException

Specified timeZoneId is not supported:

Error message

Specified timeZoneId is not supported: 

What it means

getTimeZoneId() validates the 'timeZoneId' connection property against TimeZone.getAvailableIDs() and throws SQLException('Specified timeZoneId is not supported: ...') when the supplied value is not a recognized JVM time zone ID. The value must be a valid Java TimeZone identifier; it is used to interpret TIMESTAMP values in the session.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:181

            throws SQLException
    {
        return APPLICATION_NAME_PREFIX.getValue(properties);
    }

    public Properties getProperties()
    {
        return properties;
    }

    public String getTimeZoneId()
            throws SQLException
    {
        Optional<String> timezone = TIMEZONE_ID.getValue(properties);

        if (timezone.isPresent()) {
            List<String> timeZoneIds = Arrays.asList(TimeZone.getAvailableIDs());
            if (!timeZoneIds.contains(timezone.get())) {
                throw new SQLException("Specified timeZoneId is not supported: " + timezone.get());
            }
            return timezone.get();
        }
        return TimeZone.getDefault().getID();
    }

    public Map<String, String> getExtraCredentials()
            throws SQLException
    {
        return EXTRA_CREDENTIALS.getValue(properties).orElse(ImmutableMap.of());
    }

    public Map<String, String> getCustomHeaders()
            throws SQLException
    {
        return CUSTOM_HEADERS.getValue(properties).orElse(ImmutableMap.of());
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set timeZoneId to a canonical Java TimeZone id, e.g. 'UTC', 'America/Los_Angeles', 'Asia/Kolkata'
  2. Verify the id with TimeZone.getTimeZone(value) and check it is not normalized to 'GMT' (a sign the id is invalid)
  3. If no timezone is needed, omit the property — the driver defaults to TimeZone.getDefault().getID()
  4. Install/refresh tzdata for the JVM if a legitimate zone id is reported missing (TZ updater / OS tzdata package)

Example fix

// before
String url = "jdbc:presto://host:8080/hive/default?timeZoneId=utc+2"; // invalid
// after
String url = "jdbc:presto://host:8080/hive/default?timeZoneId=Europe/Paris"; // valid Java zone id
Defensive patterns

Strategy: validation

Validate before calling

String tz = properties.getProperty("timeZoneId");
if (tz != null && java.util.Arrays.asList(java.util.TimeZone.getAvailableIDs()).noneMatch(tz::equals)) {
    throw new IllegalArgumentException("Invalid timeZoneId: " + tz);
}

Try / catch

try { conn = DriverManager.getConnection(url, props); } catch (SQLException e) { if (e.getMessage().startsWith("Specified timeZoneId is not supported")) { fixTimeZoneProperty(props); conn = DriverManager.getConnection(url, props); } else { throw e; } }

Prevention

When it happens

Trigger: Passing a connection property timeZoneId with a misspelled or non-IANA id (e.g. 'UTC+2', 'utc', 'GMT+05:30' variants not in getAvailableIDs, or empty/garbage strings) while connecting via PrestoDriver.

Common situations: Config typos in JDBC URLs (jdbc:presto://...?timeZoneId=...), using offsets like '+02:00' instead of zone ids, moving between JVMs with different tz databases, Docker images missing tzdata.

Related errors


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