prestodb/presto · error · SQLException

No host specified:

Error message

No host specified: 

What it means

JDBC URL validation in parseDriverUrl: after stripping the jdbc:presto:// prefix and parsing the remainder as a URI, the host component is empty. The driver cannot determine which coordinator to connect to, so the malformed URL (appended to the message) is rejected as a SQLException.

Source

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

                }
            }
        }

        return result;
    }

    private static URI parseDriverUrl(String url)
            throws SQLException
    {
        URI uri;
        try {
            uri = new URI(url.substring(JDBC_URL_START.length()));
        }
        catch (URISyntaxException e) {
            throw new SQLException("Invalid JDBC URL: " + url, e);
        }
        if (isNullOrEmpty(uri.getHost())) {
            throw new SQLException("No host specified: " + url);
        }
        if (uri.getPort() == -1) {
            throw new SQLException("No port number specified: " + url);
        }
        if ((uri.getPort() < 1) || (uri.getPort() > 65535)) {
            throw new SQLException("Invalid port number: " + url);
        }
        return uri;
    }

    private URI buildHttpUri()
    {
        String scheme = useSecureConnection ? "https" : "http";
        try {
            return new URI(scheme, null, address.getHost(), address.getPort(), null, null, null);
        }
        catch (URISyntaxException e) {
            throw new RuntimeException(e);

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Include the coordinator host in the URL: jdbc:presto://host:port/...
  2. Check for typos that removed the host portion of the URL
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:366 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/9e722e780ef4b827. Report an issue: GitHub.