apache/seatunnel · error · FileConnectorException

ILLEGAL_ARGUMENT

ILLEGAL_ARGUMENT

Error message

SeaTunnel does not supported this file format

What it means

BaseFileSource's schema-handling switch hit a FileFormat value it does not recognize while a user-defined schema was configured, so it throws ILLEGAL_ARGUMENT with a generic 'does not supported this file format' message. This is the defensive default branch of the switch at BaseFileSource.java:123.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/BaseFileSource.java:123

        if (pluginConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent()) {
            switch (fileFormat) {
                case CSV:
                case TEXT:
                case JSON:
                case EXCEL:
                case XML:
                    userDefinedCatalogTable = CatalogTableUtil.buildWithConfig(pluginConfig);
                    readStrategy.setCatalogTable(userDefinedCatalogTable);
                    break;
                case ORC:
                case PARQUET:
                case BINARY:
                    throw new FileConnectorException(
                            CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,
                            "SeaTunnel does not support user-defined schema for [parquet, orc, binary] files");
                default:
                    // never got in there
                    throw new FileConnectorException(
                            CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                            "SeaTunnel does not supported this file format");
            }
        } else {
            if (filePaths.isEmpty()) {
                userDefinedCatalogTable = buildCatalogTableForEmptyPath(path, fileFormat);
            } else {
                try {
                    SeaTunnelRowType rowType =
                            readStrategy.getSeaTunnelRowTypeInfo(filePaths.get(0));
                    userDefinedCatalogTable = CatalogTableUtil.getCatalogTable("default", rowType);
                } catch (FileConnectorException e) {
                    String errorMsg =
                            String.format(
                                    "Get table schema from file [%s] failed", filePaths.get(0));
                    throw new FileConnectorException(
                            CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED, errorMsg, e);
                }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Correct `file_format_type` to a supported value (text, csv, json, parquet, orc, excel, binary).
  2. Remove the user-defined `schema` block if the format is parquet/orc/binary (see UNSUPPORTED_OPERATION).
  3. Check connector version documentation — some formats are only supported in newer releases.
  4. Validate the HOCON config before submitting.

Example fix

// before
file_format_type = parqet
// after
file_format_type = parquet
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> supported = java.util.Set.of("text","csv","json","parquet","orc","excel","binary");
String fmt = config.getString("file_format_type");
if (!supported.contains(fmt)) {
    throw new IllegalArgumentException("Unsupported file_format_type: " + fmt);
}

Try / catch

try {
    // build source
} catch (FileConnectorException e) {
    if (CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT.equals(e.getErrorCode())) {
        throw new IllegalStateException("file_format_type value is not recognized — fix the enum spelling", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: An unrecognized/unsupported FileFormat enum value reaching the default case in BaseFileSource's user-defined-schema switch — normally caused by a misspelled or unsupported `file_format_type` in the source config combined with a schema block.

Common situations: Typo in file_format_type (e.g. 'parqet', 'texte'); using a format name valid elsewhere but not in this switch; config generated by tooling with a bad enum value.

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/7f7e4a5ccc528f5a. Report an issue: GitHub.