prestodb/presto · error · SQLFeatureNotSupportedException
updateFloat
Error message
updateFloat
What it means
PrestoResultSet.updateFloat(columnIndex, x) is an unimplemented stub that unconditionally throws SQLFeatureNotSupportedException. Result sets in Presto are immutable server-computed snapshots; the driver never applies in-place edits. This is the documented, intentional behavior of all updateXxx stubs in PrestoResultSet.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:816
@Override
public void updateInt(int columnIndex, int x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateInt");
}
@Override
public void updateLong(int columnIndex, long x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateLong");
}
@Override
public void updateFloat(int columnIndex, float x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateFloat");
}
@Override
public void updateDouble(int columnIndex, double x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateDouble");
}
@Override
public void updateBigDecimal(int columnIndex, BigDecimal x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateBigDecimal");
}
@Override
public void updateString(int columnIndex, String x)View on GitHub (pinned to 55bb57d202)
Solutions
- Persist the float with an UPDATE statement via PreparedStatement.setFloat
- Keep writes in SQL and treat all Presto ResultSets as CONCUR_READ_ONLY
- Feature-detect with supportsResultSetConcurrency before calling any updateXxx
- Catch SQLFeatureNotSupportedException in shared JDBC layers and fall back to statement-based writes
Example fix
// before
rs.updateFloat("score", 3.5f);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET score = ? WHERE id = ?")) {
ps.setFloat(1, 3.5f);
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 PreparedStatement UPDATE instead of rs.updateFloat
} Type guard
boolean isUpdatable(ResultSet rs) throws SQLException {
return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
} Try / catch
try {
rs.updateFloat(columnIndex, value);
} catch (SQLFeatureNotSupportedException e) {
// route to SQL UPDATE fallback
} Prevention
- Persist floats via UPDATE statements, never updateXxx
- Keep Presto access strictly read-only
- Check DatabaseMetaData capabilities at startup
- Wrap updateXxx calls in a helper that fails with a clear read-only message
When it happens
Trigger: Calling rs.updateFloat(i, value) on a Presto ResultSet, typically ahead of updateRow().
Common situations: Scientific/numeric data-editing tools writing values back through the ResultSet; code ported from updatable-ResultSet workflows on other databases.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/fcff5e5e81f57fd0.
Report an issue: GitHub.