apache/seatunnel · error · org.apache.seatunnel.common.exception.SeaTunnelRuntimeException

COMMON-19

COMMON-19

Error message

'<identifier>' unsupported convert SeaTunnel data type '<dataType>' of '<field>' to connector data type.

What it means

Thrown by OceanBaseMySqlTypeConverter.reconvert() when a SeaTunnel data type cannot be mapped back to an OceanBase (MySQL mode) column type for sink writes or table creation. Supported cases include FLOAT_VECTOR (mapped to the OceanBase VECTOR native type); everything else hits the default branch. It fails during sink schema preparation before any write.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oceanbase/OceanBaseMySqlTypeConverter.java:552

                                        + "it will be converted to timestamp({})",
                                column.getName(),
                                column.getScale(),
                                MAX_TIMESTAMP_SCALE,
                                timestampTzScale);
                    }
                    builder.columnType(String.format("%s(%s)", MYSQL_TIMESTAMP, timestampTzScale));
                    builder.scale(timestampTzScale);
                } else {
                    builder.columnType(MYSQL_TIMESTAMP);
                }
                break;
            case FLOAT_VECTOR:
                builder.nativeType(VECTOR_NAME);
                builder.columnType(String.format("%s(%s)", VECTOR_NAME, column.getScale()));
                builder.dataType(VECTOR_NAME);
                break;
            default:
                throw CommonError.convertToConnectorTypeError(
                        DatabaseIdentifier.OCEANBASE,
                        column.getDataType().getSqlType().name(),
                        column.getName());
        }

        return builder.build();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Read '<dataType>' from the message to identify the unsupported SeaTunnel SqlType.
  2. Pre-create the OceanBase table with correct VECTOR(...) DDL and disable sink auto-create.
  3. Add a Transform to convert unsupported columns (e.g. non-float vectors to float, arrays to JSON string) before the sink.
  4. Extend OceanBaseMySqlTypeConverter.reconvert() with the missing mapping and contribute upstream.

Example fix

// before
Vector<i8> column -> OceanBase sink: error
// after
transform: cast i8 vector to FLOAT_VECTOR before sink
Defensive patterns

Strategy: validation

Validate before calling

// Verify every sink column converts to an OceanBase type before DDL
for (Column col : sinkSchema.getColumns()) {
    try { new OceanBaseMySqlTypeConverter().reconvert(col); }
    catch (SeaTunnelRuntimeException e) {
        throw new IllegalStateException("OceanBase sink cannot map column " + col.getName() + " of " + col.getDataType());
    }
}

Type guard

boolean isOceanBaseSinkColumnValid(Column col) {
    try { new OceanBaseMySqlTypeConverter().reconvert(col); return true; }
    catch (SeaTunnelRuntimeException e) { return false; }
}

Try / catch

try {
    converter.reconvert(column);
} catch (SeaTunnelRuntimeException e) {
    if (e.getMessage().contains("unsupported convert SeaTunnel data type")) {
        throw new IllegalArgumentException("Only FLOAT_VECTOR and scalar types are supported for OceanBase sink: " + column.getName());
    }
    throw e;
}

Prevention

When it happens

Trigger: reconvert(Column) on OceanBaseMySqlTypeConverter where column.getDataType().getSqlType() is not handled at OceanBaseMySqlTypeConverter.java:552 — e.g. SeaTunnel Vector types other than FLOAT (VECTOR<i8>/VECTOR<f64>), or complex types (MAP/ARRAY) without an OceanBase mapping.

Common situations: Auto-creating OceanBase sink tables from vector sources with non-float element types; writing general nested/complex data into OceanBase MySQL-mode sinks; cross-database pipelines (e.g. PostgreSQL source types) whose SqlTypes lack OceanBase equivalents.

Related errors


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