apache/seatunnel · error · SeaTunnelRuntimeException

COMMON-17

COMMON-17

Error message

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

What it means

DocumentDBItemDeserializer.convert translates a BSON value into a SeaTunnel data value according to the target SeaTunnelType. When the target type is not one of the supported kinds (or conversion otherwise fails), it throws a SeaTunnelRuntimeException with error code COMMON-17 stating the field and data type are unsupported.

Source

Thrown at seatunnel-connectors-v2/connector-amazondocumentdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazondocumentdb/serialize/DocumentDBItemDeserializer.java:117

                    return convertDecimal((DecimalType) type, value);
                case STRING:
                    return convertString(value);
                case DATE:
                    return convertDateTime(value).toLocalDate();
                case TIME:
                    return convertDateTime(value).toLocalTime();
                case TIMESTAMP:
                    return convertDateTime(value);
                case BYTES:
                    return value.asBinary().getData();
                case ARRAY:
                    return convertArray(field, (ArrayType<?, ?>) type, value);
                case MAP:
                    return convertMap(field, (MapType<?, ?>) type, value);
                case ROW:
                    return convertRow(field, (SeaTunnelRowType) type, value.asDocument());
                default:
                    throw conversionError(field, type);
            }
        } catch (SeaTunnelRuntimeException e) {
            throw e;
        } catch (RuntimeException e) {
            SeaTunnelRuntimeException error = conversionError(field, type);
            error.initCause(e);
            throw error;
        }
    }

    private static boolean isNull(BsonValue value) {
        return value == null
                || value.isNull()
                || value.getBsonType() == BsonType.UNDEFINED
                || (value.isDecimal128() && value.asDecimal128().getValue().isNaN());
    }

    private static int checkedInteger(BsonValue value, int minimum, int maximum) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the declared SeaTunnel schema for the offending field ('<field>'/'<dataType>' in the message) and change it to a supported type (STRING, INT, BIGINT, DOUBLE, BOOLEAN, ARRAY, MAP with string keys, ROW for documents)
  2. Use Transform-SQL/field filtering upstream to drop or cast unsupported fields before the sink/source mapping
  3. Upgrade SeaTunnel — newer releases extend the supported BSON conversions
  4. Wrap the identifier from the exception message and inspect the actual BSON type in the collection to confirm the mismatch

Example fix

// before: schema declares BYTES for a BSON Binary field
SeaTunnelRowType.of(new String[]{"data"}, new SeaTunnelType[]{BytesType.class})
// after: use a supported mapping
SeaTunnelRowType.of(new String[]{"data"}, new SeaTunnelType[]{StringType.class}) // decode Binary as base64/string
Defensive patterns

Strategy: validation

Validate before calling

// before reading, check the schema maps only supported SqlTypes
for (SeaTunnelType<?> t : rowType.getFieldTypes()) {
  switch (t.getSqlType()) { case STRING: case INT: case BIGINT: case DOUBLE: case BOOLEAN: case ARRAY: case MAP: case ROW: continue; default: throw new IllegalArgumentException("unsupported: " + t); }
}

Try / catch

try { deserialize(item); } catch (SeaTunnelRuntimeException e) { if (e.getMessage().contains("COMMON-17")) { log.error("unsupported field type: {}", e.getMessage()); } throw e; }

Prevention

When it happens

Trigger: A DocumentDB document field maps to a SeaTunnel type whose SqlType falls into the switch's default branch (e.g., an unsupported type like ARRAY with unexpected inner type, ROW conversions of non-document values), or the raw conversion throws a RuntimeException that is re-wrapped as conversionError.

Common situations: Schema inferred from the collection contains a BSON type not handled by the deserializer; source collection has mixed-type fields where a row field contains a non-document BSON value; map declared with non-string key.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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