prestodb/presto · error · SQLFeatureNotSupportedException

Batches not supported

Error message

Batches not supported

What it means

addBatch(String) in PrestoStatement always throws SQLFeatureNotSupportedException after checkOpen(): statement-level SQL batching is not implemented by the Presto JDBC driver, so any batch accumulation via addBatch is rejected.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:424

    {
        checkOpen();
        return ResultSet.CONCUR_READ_ONLY;
    }

    @Override
    public int getResultSetType()
            throws SQLException
    {
        checkOpen();
        return ResultSet.TYPE_FORWARD_ONLY;
    }

    @Override
    public void addBatch(String sql)
            throws SQLException
    {
        checkOpen();
        throw new SQLFeatureNotSupportedException("Batches not supported");
    }

    @Override
    public void clearBatch()
            throws SQLException
    {
        checkOpen();
        throw new SQLFeatureNotSupportedException("Batches not supported");
    }

    @Override
    public int[] executeBatch()
            throws SQLException
    {
        checkOpen();
        throw new SQLFeatureNotSupportedException("Batches not supported");
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Execute statements individually in a loop instead of using addBatch/executeBatch
  2. Use multi-row INSERT statements (or a prepared statement with values) for bulk inserts
  3. Catch SQLFeatureNotSupportedException in generic JDBC abstraction layers
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:424 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/eb9d46a5c68bd4e2. Report an issue: GitHub.