apache/seatunnel · error · IllegalArgumentException

Unsupported file_format_type: <fileFormatType>. Phase 1 supp

Error message

Unsupported file_format_type: <fileFormatType>. Phase 1 supports only text

What it means

PythonSourceConfig.validate() throws this IllegalArgumentException when file_format_type is anything other than 'text' (case-insensitive). Phase 1 of this connector deliberately restricts output deserialization to the text format, so other formats are rejected at config validation.

Source

Thrown at seatunnel-connectors-v2/connector-python/src/main/java/org/apache/seatunnel/connectors/seatunnel/python/source/PythonSourceConfig.java:92

    }

    public String getFieldDelimiter() {
        return fieldDelimiter;
    }

    /**
     * Phase 1 keeps the stdout contract intentionally narrow so the first implementation can stay
     * compatible with the existing text deserializer.
     */
    private void validate() {
        if (StringUtils.isBlank(pythonExecutable)) {
            throw new IllegalArgumentException("python.executable must not be blank");
        }
        if (StringUtils.isBlank(pythonScriptPath)) {
            throw new IllegalArgumentException("python.script.path must not be blank");
        }
        if (!SUPPORTED_FILE_FORMAT.equalsIgnoreCase(fileFormatType)) {
            throw new IllegalArgumentException(
                    "Unsupported file_format_type: "
                            + fileFormatType
                            + ". Phase 1 supports only text");
        }
        if (fieldDelimiter == null) {
            throw new IllegalArgumentException("field_delimiter must not be null");
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change file_format_type to "text".
  2. Remove the file_format_type line if the default already is text.
  3. Pre-transform data to plain text lines inside the Python script if structured parsing is needed.
  4. Check connector release notes for later phases that may add more formats.

Example fix

// before
Python {
  file_format_type = "json"
}
// after
Python {
  file_format_type = "text"
}
Defensive patterns

Strategy: validation

Validate before calling

// Java: only allow the Phase 1 format
String fmt = configMap.getOrDefault("file_format_type", "text");
if (!"text".equalsIgnoreCase(fmt)) {
    throw new IllegalArgumentException("file_format_type must be 'text' (Phase 1), got: " + fmt);
}

Try / catch

try { cfg = new PythonSourceConfig(configMap); } catch (IllegalArgumentException e) { LOG.error("Invalid python source config: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Setting file_format_type = "json" (or csv, parquet, etc.) in a Python source config; validate() compares the parsed format type against SUPPORTED_FILE_FORMAT and fails for any mismatch.

Common situations: Reusing a file sink/source config snippet that uses json format; upgrading from docs or examples assuming broader format support; assuming case sensitivity matters (it does not — 'TEXT' is accepted).

Related errors


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