apache/seatunnel · error · UnsupportedOperationException

Unsupported JDBC type:

Error message

Unsupported JDBC type: 

What it means

JdbcColumnConverter.convert() maps JDBC java.sql.Types values to SeaTunnel PhysicalColumn types; when the result-set metadata reports a JDBC type not covered by the switch (e.g. vendor-specific or rarely used types like REF_CURSOR, SQLXML, or driver-specific mappings), it throws UnsupportedOperationException 'Unsupported JDBC type: <type>'. This means the connector cannot translate that column's type into a SeaTunnel type.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/utils/JdbcColumnConverter.java:236

                seaTunnelType = LocalTimeType.LOCAL_DATE_TYPE;
                break;
            case TIME:
            case TIME_WITH_TIMEZONE:
                seaTunnelType = LocalTimeType.LOCAL_TIME_TYPE;
                break;
            case TIMESTAMP:
            case TIMESTAMP_WITH_TIMEZONE:
                seaTunnelType = LocalTimeType.LOCAL_DATE_TIME_TYPE;
                break;
            case BINARY:
            case VARBINARY:
            case LONGVARBINARY:
            case BLOB:
                seaTunnelType = PrimitiveByteArrayType.INSTANCE;
                bitLength = precision * 8;
                break;
            default:
                throw new UnsupportedOperationException("Unsupported JDBC type: " + jdbcType);
        }

        return PhysicalColumn.of(
                columnName,
                seaTunnelType,
                columnLength,
                isNullable != ResultSetMetaData.columnNoNulls,
                null,
                comment,
                nativeType,
                false,
                false,
                bitLength,
                Collections.emptyMap(),
                longColumnLength);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Identify the offending type number from the message and map it to java.sql.Types to see what the column is.
  2. Change the column type in the source table to a supported equivalent (e.g. convert XML/UDT to VARCHAR/CLOB).
  3. Upgrade connector-jdbc — newer versions add more type mappings in JdbcColumnConverter.
  4. If you control the code, add a case for the type in the switch mapping it to the closest SeaTunnel type (e.g. VARCHAR for SQLXML).

Example fix

// before
columns: [ payload OTHER ]  // jdbcType OTHER -> UnsupportedOperationException
// after
case OTHER:
    seaTunnelType = StringType.STRING; // or cast the column to VARCHAR in the source
    break;
Defensive patterns

Strategy: type-guard

Validate before calling

// java
ResultSetMetaData md = rs.getMetaData();
for (int i = 1; i <= md.getColumnCount(); i++) {
    int t = md.getColumnType(i);
    if (t == Types.OTHER || t == Types.NULL || t == Types.REF_CURSOR) {
        throw new IllegalArgumentException("unsupported JDBC type " + t + " on column " + md.getColumnName(i));
    }
}

Type guard

// java
static boolean isSupportedJdbcType(int jdbcType) {
    switch (jdbcType) {
        case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR:
        case Types.NUMERIC: case Types.DECIMAL: case Types.TINYINT:
        case Types.SMALLINT: case Types.INTEGER: case Types.BIGINT:
        case Types.REAL: case Types.FLOAT: case Types.DOUBLE:
        case Types.DATE: case Types.TIME: case Types.TIMESTAMP:
        case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY:
        case Types.BLOB:
            return true;
        default:
            return false;
    }
}

Try / catch

// java
try {
    PhysicalColumn col = converter.convert(metaData, i);
} catch (UnsupportedOperationException e) {
    LOG.warn("falling back to STRING for: {}", e.getMessage());
    col = PhysicalColumn.of(name, StringType.STRING, 0, true, null, null, null);
}

Prevention

When it happens

Trigger: Reading a table whose column metadata contains an unmapped JDBC type integer — e.g. custom driver type codes from less-common databases, TIMESTAMP_WITH_TIMEZONE variants on older drivers, or NULL/OTHER types — during catalog schema reads or source type conversion.

Common situations: Connecting to a database whose driver maps proprietary types to unusual java.sql.Types codes; using an outdated JDBC driver that reports different type codes; tables with computed/exotic column types (XML, arrays, UDTs) that the converter has no case for.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/5f233c3407783ad9. Report an issue: GitHub.