apache/seatunnel · error · FileConnectorException

COMMON_ERROR_CODE-17

COMMON_ERROR_CODE-17

Error message

Unsupported data type: %s

What it means

During XML row parsing, convert() maps each field's SeaTunnelType to a deserialization strategy. Types outside the handled SQL types (primitives, MAP, ARRAY) hit the default branch and throw UNSUPPORTED_DATA_TYPE.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/XmlReadStrategy.java:306

                return new BigDecimal(fieldValue);
            case BOOLEAN:
                return Boolean.parseBoolean(fieldValue);
            case BYTES:
                return fieldValue.getBytes(StandardCharsets.UTF_8);
            case NULL:
                return "";
            case ROW:
                String[] context = fieldValue.split(delimiter);
                SeaTunnelRowType ft = (SeaTunnelRowType) fieldType;
                SeaTunnelRow row = new SeaTunnelRow(context.length);
                IntStream.range(0, context.length)
                        .forEach(i -> row.setField(i, convert(context[i], ft.getFieldTypes()[i])));
                return row;
            case MAP:
            case ARRAY:
                return objectMapper.readValue(fieldValue, fieldType.getTypeClass());
            default:
                throw new FileConnectorException(
                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                        String.format("Unsupported data type: %s", sqlType));
        }
    }

    private String getXPathExpression(String tableRowIdentification) {
        return String.format("//%s", tableRowIdentification);
    }

    /** Performs pre-checks and initialization of the configuration for reading XML files. */
    private void preCheckAndInitializeConfiguration() {
        ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(pluginConfig);
        this.tableRowName = readonlyConfig.get(FileBaseSourceOptions.XML_ROW_TAG);
        this.useAttrFormat = readonlyConfig.get(FileBaseSourceOptions.XML_USE_ATTR_FORMAT);

        // Check mandatory configurations
        if (StringUtils.isEmpty(tableRowName) || useAttrFormat == null) {
            throw new FileConnectorException(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Remove or flatten unsupported complex field types (e.g. ROW) from the schema; use MAP or ARRAY or primitives.
  2. Convert unsupported types to strings in the schema and post-process in a transform.
  3. Upgrade SeaTunnel to a version with broader XML type support.

Example fix

// before
schema = { fields { address = { city = string } } }
// after
schema = { fields { address = string } }
Defensive patterns

Strategy: type-guard

Validate before calling

for (CatalogTable.Field f : schema.getFields()) {
  SqlType t = f.getType().getSqlType();
  if (t == SqlType.ROW) throw new IllegalArgumentException("XML source does not support ROW type: " + f.getName());
}

Type guard

boolean isXmlSupportedType(SeaTunnelDataType<?> t) {
  switch (t.getSqlType()) {
    case STRING: case INT: case BIGINT: case DOUBLE: case BOOLEAN:
    case MAP: case ARRAY: return true;
    default: return false;
  }
}

Try / catch

try {
  rows = reader.read();
} catch (FileConnectorException e) {
  if (e.getMessage().startsWith("Unsupported data type:")) {
    LOG.error("Flatten schema; unsupported XML type: {}", e.getMessage());
  }
  throw e;
}

Prevention

When it happens

Trigger: readProcess reads an XML row whose declared schema contains a field type not handled by convert (e.g. ROW/struct or other complex types), or a nested convert call hits the same default branch.

Common situations: Declaring nested row/struct columns in the schema for an XML source, or using decimal/datetime types not supported by this strategy version.

Related errors


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