apache/seatunnel · error · SeaTunnelRuntimeException

COMMON-19

COMMON-19

Error message

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

What it means

ClickhouseTypeConverter.reconvert() maps a SeaTunnel CatalogTable column's data type back to a ClickHouse column type string. If the column's SqlType has no case in the switch, it throws CommonError.convertToConnectorTypeError (COMMON-19): the SeaTunnel type cannot be represented as a ClickHouse type. Notably this method is also reused by the Doris and MaxCompute type converters (columnToDorisType, columnToMaxComputeType).

Source

Thrown at seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseTypeConverter.java:173

                    ArrayType arrayType = (ArrayType) arrayDataType;
                    elementType = arrayType.getElementType();
                }

                Column arrayKeyColumn =
                        PhysicalColumn.of(
                                column.getName() + ".key",
                                (SeaTunnelDataType<?>) elementType,
                                (Long) null,
                                true,
                                null,
                                null);
                String arrayKeyColumnType = reconvert(arrayKeyColumn).getColumnType();
                builder.dataType(ClickhouseType.ARRAY);
                builder.columnType(
                        String.format("%s(%s)", ClickhouseType.ARRAY, arrayKeyColumnType));
                break;
            default:
                throw CommonError.convertToConnectorTypeError(
                        IDENTIFIER, column.getDataType().getSqlType().name(), column.getName());
        }
        return builder.build();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change or cast the offending column to a mapped type (STRING, INT, BIGINT, FLOAT, DOUBLE, BOOLEAN, DATE, TIMESTAMP, BYTES, ARRAY, MAP, ROW as supported).
  2. Drop the unsupported column from the table schema before writing.
  3. Upgrade the connector to a version with a broader ClickhouseTypeConverter mapping.
  4. Patch reconvert() to add the missing SqlType -> ClickHouse type mapping if a sensible equivalent exists.

Example fix

// before
CatalogColumn c = CatalogColumn.of("eta", LocalTimeType.LOCAL_TIME_TYPE); // TIME unmapped
// after
CatalogColumn c = CatalogColumn.of("eta", BasicType.STRING_TYPE); // or cast TIME to string
Defensive patterns

Strategy: validation

Validate before calling

java
Set<SqlType> mapped = EnumSet.of(SqlType.STRING, SqlType.INT, SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE, SqlType.BOOLEAN, SqlType.DATE, SqlType.TIMESTAMP, SqlType.BYTES, SqlType.ARRAY, SqlType.MAP, SqlType.ROW);
catalogTable.getTableSchema().getColumns().forEach(c -> {
    if (!mapped.contains(c.getDataType().getSqlType())) {
        throw new IllegalArgumentException("Column '" + c.getName() + "' type " + c.getDataType().getSqlType() + " not mappable to ClickHouse");
    }
});

Prevention

When it happens

Trigger: Building a ClickHouse catalog/table from a SeaTunnel CatalogTable whose column data type hits the switch default — e.g. types like TIME, NULL, or other unmapped SqlTypes. Reached via reconvert() during schema conversion.

Common situations: Sourcing from a database with types ClickHouse mapping lacks (e.g. TIME or INTERVAL columns); copying schemas across Doris/MaxCompute/ClickHouse sinks; adding a new SeaTunnel type not yet mapped by this converter version.

Related errors


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