apache/seatunnel · error · JdbcConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Unexpected value: 

What it means

KingbaseJdbcRowConverter.toInternal hits its default switch branch when converting a JDBC value whose SeaTunnel data type is ROW, MAP, ARRAY, or any otherwise-unhandled type. The Kingbase row converter does not implement conversion for composite types, so it throws UNSUPPORTED_DATA_TYPE.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/kingbase/KingbaseJdbcRowConverter.java:118

                    fields[fieldIndex] =
                            Optional.ofNullable(sqlTimestamp)
                                    .map(Timestamp::toLocalDateTime)
                                    .orElse(null);
                    break;
                case TIMESTAMP_TZ:
                    fields[fieldIndex] = JdbcFieldTypeUtils.getOffsetDateTime(rs, resultSetIndex);
                    break;
                case BYTES:
                    fields[fieldIndex] = JdbcFieldTypeUtils.getBytes(rs, resultSetIndex);
                    break;
                case NULL:
                    fields[fieldIndex] = null;
                    break;
                case ROW:
                case MAP:
                case ARRAY:
                default:
                    throw new JdbcConnectorException(
                            CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                            "Unexpected value: " + seaTunnelDataType);
            }
        }
        return new SeaTunnelRow(fields);
    }

    @Override
    public PreparedStatement toExternal(
            TableSchema tableSchema,
            @Nullable TableSchema databaseTableSchema,
            SeaTunnelRow row,
            PreparedStatement statement)
            throws SQLException {
        SeaTunnelRowType rowType = tableSchema.toPhysicalRowDataType();
        for (int fieldIndex = 0; fieldIndex < rowType.getTotalFields(); fieldIndex++) {
            SeaTunnelDataType<?> seaTunnelDataType = rowType.getFieldType(fieldIndex);
            int statementIndex = fieldIndex + 1;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Exclude complex columns from the configured schema; select only scalar columns.
  2. Cast the column in the query (e.g. to VARCHAR/TEXT) and read it as a string.
  3. Implement the missing case in KingbaseJdbcRowConverter.toInternal to support the type.

Example fix

// before
columns = ["id", "tags"]  // tags is an array column
// after
columns = ["id", "CAST(tags AS VARCHAR) AS tags"]  // read as string
Defensive patterns

Strategy: validation

Validate before calling

// Before the sink/source run, assert no composite columns
boolean hasComplex = schema.getFields().stream()
  .anyMatch(f -> f.getDataType() instanceof SeaTunnelRowType
      || f.getDataType() instanceof SeaTunnelMapType
      || f.getDataType() instanceof SeaTunnelArrayType);
if (hasComplex) throw new IllegalArgumentException("Kingbase JDBC converter does not support ROW/MAP/ARRAY columns");

Try / catch

try {
  row = converter.toInternal(resultSet);
} catch (JdbcConnectorException e) {
  if (e.getCode() == CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE) {
    // cast the offending column to VARCHAR in the query and re-read as STRING
  }
}

Prevention

When it happens

Trigger: Reading a Kingbase table whose schema is mapped (via KingbaseTypeMapper) to SeaTunnel ROW, MAP, or ARRAY column types; toInternal's switch on SeaTunnelDataType falls through to default.

Common situations: Tables with structured/complex or array-like columns (e.g. Kingbase JSON/structured columns mapped to complex SeaTunnel types); schema mismatch between the configured schema and the physical table.

Related errors


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