prestodb/presto · error · NotImplementedException

Not implemented: PreparedStatement.setBinaryStream

Error message

Not implemented: PreparedStatement.setBinaryStream

What it means

setBinaryStream is not implemented by PrestoPreparedStatement: any call throws NotImplementedException. Binary stream binding of parameters has no Presto equivalent because parameter values are serialized as SQL literals, so the driver refuses the operation unconditionally.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java:302

    @Override
    public void setAsciiStream(int parameterIndex, InputStream x, int length)
            throws SQLException
    {
        throw new NotImplementedException("PreparedStatement", "setAsciiStream");
    }

    @Override
    public void setUnicodeStream(int parameterIndex, InputStream x, int length)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("setUnicodeStream");
    }

    @Override
    public void setBinaryStream(int parameterIndex, InputStream x, int length)
            throws SQLException
    {
        throw new NotImplementedException("PreparedStatement", "setBinaryStream");
    }

    @Override
    public void clearParameters()
            throws SQLException
    {
        checkOpen();
        parameters.clear();
    }

    @Override
    public void setObject(int parameterIndex, Object x, int targetSqlType)
            throws SQLException
    {
        checkOpen();
        if (x == null) {
            setNull(parameterIndex, targetSqlType);
            return;

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Read the InputStream into a byte[] and call setBytes instead
  2. Bind binary data as a hex or base64 string literal via setString
  3. Skip stream-based parameter setting when using the Presto JDBC driver
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java:302 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/81387fa0124868bc. Report an issue: GitHub.