apache/seatunnel · error · UnsupportedOperationException

Unsupported type ${type}

Error message

Unsupported type ${type}

What it means

UnsupportedOperationException thrown by DiscoveryWalFileFactory.getReader when the configured storage `type` does not map to a known FileConfiguration enum value (HDFS, S3, OSS). getReader validates the type and only returns a DefaultReader for the three supported backends; anything else falls through to this throw.

Source

Thrown at seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/wal/DiscoveryWalFileFactory.java:40

import org.apache.seatunnel.engine.imap.storage.file.config.FileConfiguration;
import org.apache.seatunnel.engine.imap.storage.file.wal.reader.DefaultReader;
import org.apache.seatunnel.engine.imap.storage.file.wal.reader.IFileReader;
import org.apache.seatunnel.engine.imap.storage.file.wal.writer.HdfsWriter;
import org.apache.seatunnel.engine.imap.storage.file.wal.writer.IFileWriter;
import org.apache.seatunnel.engine.imap.storage.file.wal.writer.OssWriter;
import org.apache.seatunnel.engine.imap.storage.file.wal.writer.S3Writer;

public class DiscoveryWalFileFactory {

    public static IFileReader getReader(String type) {
        FileConfiguration configuration = FileConfiguration.valueOf(type.toUpperCase());
        switch (configuration) {
            case HDFS:
            case S3:
            case OSS:
                return new DefaultReader();
        }
        throw new UnsupportedOperationException("Unsupported type " + type);
    }

    public static IFileWriter getWriter(String type) {
        FileConfiguration configuration = FileConfiguration.valueOf(type.toUpperCase());
        switch (configuration) {
            case HDFS:
                return new HdfsWriter();
            case S3:
                return new S3Writer();
            case OSS:
                return new OssWriter();
        }
        throw new UnsupportedOperationException("Unsupported type " + type);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the storage type to one of: hdfs, s3, oss
  2. Trim and normalize the type string before passing it (type.trim().toUpperCase())
  3. Check the config file for typos or extra characters in the type field
  4. Implement a custom reader and register it if a new backend is genuinely needed

Example fix

// before
IFileReader reader = DiscoveryWalFileFactory.getReader("s3a");
// after
IFileReader reader = DiscoveryWalFileFactory.getReader("s3");
Defensive patterns

Strategy: validation

Validate before calling

import static org.apache.seatunnel.engine.imap.storage.file.api.FileConfiguration.*;
Set<String> supported = Set.of("HDFS", "S3", "OSS");
if (type == null || !supported.contains(type.trim().toUpperCase()))
    throw new IllegalArgumentException("storage type must be one of " + supported);

Try / catch

try {
    reader = DiscoveryWalFileFactory.getReader(type);
} catch (UnsupportedOperationException e) {
    LOG.error("Unsupported storage type: {}", type);
    reader = DiscoveryWalFileFactory.getReader("hdfs"); // or fail fast
}

Prevention

When it happens

Trigger: Calling DiscoveryWalFileFactory.getReader(type) with a type string that is not "hdfs", "s3", or "oss" (case-insensitive after toUpperCase), including null/empty strings which fail valueOf.

Common situations: Typo in storage type config (e.g. "s3a", "hdfs2"); config file using a lowercase scheme with extra whitespace; upgrading SeaTunnel where a formerly-supported type was removed.

Related errors


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