prestodb/presto · error · SQLException
Unsupported target SQL type:
Error message
Unsupported target SQL type:
What it means
In setObject(parameterIndex, x, targetSqlType) the switch over targetSqlType has no case matching the requested JDBC type (and no default conversion), so the driver throws this SQLException. It means the requested target SQL type is not supported for object conversion by the Presto driver — a generic guard reached with an out-of-support targetSqlType value.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java:375
return;
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
setBytes(parameterIndex, castToBinary(x, targetSqlType));
return;
case Types.DATE:
setDate(parameterIndex, castToDate(x, targetSqlType));
return;
case Types.TIME:
setTime(parameterIndex, castToTime(x, targetSqlType));
return;
case Types.TIMESTAMP:
setTimestamp(parameterIndex, castToTimestamp(x, targetSqlType));
return;
// TODO Types.TIME_WITH_TIMEZONE
// TODO Types.TIMESTAMP_WITH_TIMEZONE
}
throw new SQLException("Unsupported target SQL type: " + targetSqlType);
}
@Override
public void setObject(int parameterIndex, Object x, SQLType targetSqlType)
throws SQLException
{
setObject(parameterIndex, x, targetSqlType.getVendorTypeNumber());
}
@Override
public void setObject(int parameterIndex, Object x)
throws SQLException
{
checkOpen();
if (x == null) {
setNull(parameterIndex, Types.NULL);
}
else if (x instanceof Boolean) {View on GitHub (pinned to 55bb57d202)
Solutions
- Use a supported targetSqlType such as BOOLEAN, INTEGER, BIGINT, DOUBLE, VARCHAR, VARBINARY, DATE, TIME or TIMESTAMP
- Set the object without an explicit target type via setObject(index, value) where possible
- Convert the value in Java to a supported Java class before binding
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java:375 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/1da6530b550f0df6.
Report an issue: GitHub.