prestodb/presto · error · SQLFeatureNotSupportedException

updateBlob

Error message

updateBlob

What it means

Sentinel unsupported-operation method in PrestoResultSet: the JDBC driver does not support Blob updates on a result set, so updateBlob always throws SQLFeatureNotSupportedException with the method name as the message. Calling it from client code is the only trigger.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1243

    @Override
    public void updateRef(int columnIndex, Ref x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateRef");
    }

    @Override
    public void updateRef(String columnLabel, Ref x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateRef");
    }

    @Override
    public void updateBlob(int columnIndex, Blob x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateBlob");
    }

    @Override
    public void updateBlob(String columnLabel, Blob x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateBlob");
    }

    @Override
    public void updateClob(int columnIndex, Clob x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateClob");
    }

    @Override
    public void updateClob(String columnLabel, Clob x)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Insert/update binary data with PreparedStatement.setBytes (mapped to VARBINARY)
  2. Never attempt in-place ResultSet updates with the Presto driver
  3. If large object streaming is required, chunk the data at the application level

Example fix

// before
rs.updateBlob(1, blob);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET data = ? WHERE id = ?")) {
    ps.setBytes(1, bytes);
    ps.setLong(2, id);
    ps.executeUpdate();
}
Defensive patterns

Strategy: validation

Validate before calling

DatabaseMetaData md = conn.getMetaData();
if (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) { /* use UPDATE with setBytes */ }

Try / catch

try {
    rs.updateBlob(columnIndex, blob);
} catch (SQLFeatureNotSupportedException e) {
    // fall back to PreparedStatement with setBytes
}

Prevention

When it happens

Trigger: Calling rs.updateBlob(columnIndex, blob) on any PrestoResultSet.

Common situations: Binary-write code ported from MySQL/PostgreSQL apps; frameworks that write binary columns through updatable result sets.

Related errors


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