apache/seatunnel · error · SeaTunnelJsonFormatException

CommonErrorCode.UNSUPPORTED_DATA_TYPE

CommonErrorCode.UNSUPPORTED_DATA_TYPE

Error message

Unsupported format: %s

What it means

PulsarSource.createDeserialization switches on the configured format to build the deserialization schema; the default branch throws SeaTunnelJsonFormatException(UNSUPPORTED_DATA_TYPE, "Unsupported format: ...") when the format is not one of the supported values.

Source

Thrown at seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/source/PulsarSource.java:289

                        false, false, catalogTable.getSeaTunnelRowType());
            case "CANAL_JSON":
                return new PulsarCanalDecorator(
                        CanalJsonDeserializationSchema.builder(catalogTable)
                                .setIgnoreParseErrors(true)
                                .build());
            case "AVRO":
                return new AvroDeserializationSchema(catalogTable);
            case "TEXT":
                return TextDeserializationSchema.builder()
                        .seaTunnelRowType(catalogTable.getSeaTunnelRowType())
                        .delimiter(
                                tableConfig
                                        .getSchemaConfig()
                                        .get(PulsarSourceOptions.FIELD_DELIMITER))
                        .setCatalogTable(catalogTable)
                        .build();
            default:
                throw new SeaTunnelJsonFormatException(
                        CommonErrorCode.UNSUPPORTED_DATA_TYPE, "Unsupported format: " + format);
        }
    }

    private void validateBoundedDiscovery() {
        boolean hasTopicPattern;
        if (partitionDiscoverer instanceof TopicPatternDiscoverer) {
            hasTopicPattern = true;
        } else if (partitionDiscoverer instanceof MultiTablePartitionDiscoverer) {
            hasTopicPattern =
                    ((MultiTablePartitionDiscoverer) partitionDiscoverer).hasTopicPattern();
        } else {
            hasTopicPattern = false;
        }

        if (hasTopicPattern
                && partitionDiscoveryIntervalMs > 0
                && Boundedness.BOUNDED == getBoundedness()) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set format to a supported value (e.g. 'json', 'text', 'canal-json', 'debezium-json' — check PulsarSourceOptions/constants).
  2. Fix casing/spelling of the format string in tables_configs.
  3. If the payload needs an unsupported format, pre-transform it (e.g. via a transform) or use a supported format at the producer side.

Example fix

// before
source {
  Pulsar {
    schema {
      format = "JSON"
    }
  }
}
// after
source {
  Pulsar {
    schema {
      format = "json"
    }
  }
}
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supported = Set.of("json", "text", "canal-json", "debezium-json");
if (!supported.contains(format.toLowerCase())) {
    throw new IllegalArgumentException("Unsupported Pulsar source format: " + format);
}

Try / catch

try {
    DeserializationSchema s = createDeserialization(format, tableConfig, catalogTable);
} catch (SeaTunnelJsonFormatException e) {
    log.error("Unsupported source format '{}'; check schema.format", format);
    throw e;
}

Prevention

When it happens

Trigger: A table's schema config sets format to an unsupported value (typo, wrong casing, or a format only valid elsewhere like 'parquet'); createConsumerMetadata -> createDeserialization hits default.

Common situations: Typo in 'format' under the table's schema config; reusing formats from other connectors; case mismatch ('JSON'); format removed/renamed in a SeaTunnel upgrade.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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