apache/flink · error · ValidationException

Could not find any format factory for identifier '%s' in the

Error message

Could not find any format factory for identifier '%s' in the classpath.

What it means

FileSystemTableSource's constructor checks that at least one reader format (bulkReaderFormat or deserializationFormat) is non-null. If both are null — meaning no decoding format was discovered for reading — it throws a ValidationException. The format identifier is retrieved from table options for the error message. This is a table-creation-time validation performed in the constructor.

Source

Thrown at flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/FileSystemTableSource.java:116

    // These mutable fields
    private List<Map<String, String>> remainingPartitions;
    private List<ResolvedExpression> filters;
    private Long limit;
    private int[][] projectFields;
    private List<String> metadataKeys;
    private DataType producedDataType;

    public FileSystemTableSource(
            ObjectIdentifier tableIdentifier,
            DataType physicalRowDataType,
            List<String> partitionKeys,
            ReadableConfig tableOptions,
            @Nullable DecodingFormat<BulkFormat<RowData, FileSourceSplit>> bulkReaderFormat,
            @Nullable DecodingFormat<DeserializationSchema<RowData>> deserializationFormat) {
        super(tableIdentifier, physicalRowDataType, partitionKeys, tableOptions);
        if (Stream.of(bulkReaderFormat, deserializationFormat).allMatch(Objects::isNull)) {
            String identifier = tableOptions.get(FactoryUtil.FORMAT);
            throw new ValidationException(
                    String.format(
                            "Could not find any format factory for identifier '%s' in the classpath.",
                            identifier));
        }
        this.bulkReaderFormat = bulkReaderFormat;
        this.deserializationFormat = deserializationFormat;
        this.producedDataType = physicalRowDataType;
    }

    @Override
    public ScanRuntimeProvider getScanRuntimeProvider(ScanContext scanContext) {
        // When this table has no partition, just return an empty source.
        if (!partitionKeys.isEmpty() && getOrFetchPartitions().isEmpty()) {
            return InputFormatProvider.of(new CollectionInputFormat<>(new ArrayList<>(), null));
        }

        // Resolve metadata and make sure to filter out metadata not in the producedDataType
        final List<String> metadataKeys =

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Add the required format JAR to the classpath of the SQL client or job (e.g. flink-sql-parquet.jar for parquet).
  2. Verify the 'format' option value matches a known format identifier exactly (parquet, csv, json, orc, avro).
  3. Check ServiceLoader discovery: ensure META-INF/services entries are present in the format JAR.
  4. If running in a cluster, ensure the format JAR is shipped to all TaskManagers.

Example fix

-- before
CREATE TABLE source_t (a INT) WITH (
  'connector'='filesystem',
  'path'='file:///in',
  'format'='unknownformat'
);

-- after
CREATE TABLE source_t (a INT) WITH (
  'connector'='filesystem',
  'path'='file:///in',
  'format'='parquet'
);
-- ensure flink-sql-parquet.jar is on the classpath
Defensive patterns

Strategy: validation

Validate before calling

// Verify format JAR availability before table creation
String formatId = options.get("format");
if (formatId == null) {
    throw new ValidationException("'format' option is required for filesystem source");
}
boolean found = ServiceLoader.load(Factory.class)
    .stream()
    .anyMatch(p -> p.get().identifier().equals(formatId));
if (!found) {
    throw new ValidationException(
        "No format factory for '" + formatId + "'. Add the format JAR to the classpath.");
}

Prevention

When it happens

Trigger: A CREATE TABLE with connector='filesystem' specifies a 'format' option for which no DecodingFormat factory is found in the classpath. For example, specifying 'format'='xyz' where no factory with identifier 'xyz' exists, or the format JAR is not on the classpath.

Common situations: The format JAR (e.g. flink-sql-parquet, flink-sql-csv) is not on the classpath when the table is created. Typo in the format identifier. Using a format identifier that no plugin provides. Classloader isolation issue preventing factory discovery via ServiceLoader.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/675eabd85ec23d4a. Report an issue: GitHub.