apache/seatunnel · error · java.lang.IllegalArgumentException

Condition operator must not be null

Error message

Condition operator must not be null

What it means

ExcelReadStrategy.getPoiExcelMaxFileSize reads the poi_excel_max_file_size option (falling back to its default) and validates it is strictly greater than 0. A non-positive value would make the POI file-size guard meaningless, so it throws FileConnectorException with ILLEGAL_ARGUMENT before any file is read.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/Condition.java:58

        this(option, ConditionOperator.EQUAL, expectValue, null, null);
    }

    Condition(
            Option<T> option, ConditionOperator operator, T expectValue, Option<?> compareOption) {
        this(option, operator, expectValue, compareOption, null);
    }

    Condition(
            Option<T> option,
            ConditionOperator operator,
            T expectValue,
            Option<?> compareOption,
            ConditionExtension<T> extension) {
        if (option == null) {
            throw new IllegalArgumentException("Condition option must not be null");
        }
        if (operator == null) {
            throw new IllegalArgumentException("Condition operator must not be null");
        }
        if (operator.getSource() == ConditionOperator.Source.FIELD && compareOption == null) {
            throw new IllegalArgumentException(
                    String.format(
                            "Operator %s requires a compareOption (cross-field comparison), but compareOption is null",
                            operator.name()));
        }
        if (operator.getArity() == ConditionOperator.Arity.BINARY
                && operator.getSource() == ConditionOperator.Source.LITERAL
                && expectValue == null) {
            throw new IllegalArgumentException(
                    String.format(
                            "Operator %s requires an expectValue, but expectValue is null",
                            operator.name()));
        }
        if (operator == ConditionOperator.EXTENSION && extension == null) {
            throw new IllegalArgumentException(
                    "Operator EXTENSION requires a non-null ConditionExtension");

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set poi_excel_max_file_size to a positive byte value, e.g. 104857600 for 100MB.
  2. Remove the option to use the default limit instead of setting 0.
  3. To effectively bypass the limit for huge POI files, set a very large positive value and size worker heap accordingly.

Example fix

// before
poi_excel_max_file_size = 0
// after
poi_excel_max_file_size = 104857600
Defensive patterns

Strategy: validation

Validate before calling

java
if (pluginConfig.hasPath("poi_excel_max_file_size")
        && pluginConfig.getLong("poi_excel_max_file_size") <= 0) {
    throw new IllegalArgumentException("poi_excel_max_file_size must be > 0 (bytes)");
}

Try / catch

java
try {
    reader.readProcess(split);
} catch (FileConnectorException e) {
    if (e.getMessage().contains("must be greater than 0")) {
        LOG.error("Fix poi_excel_max_file_size — it is a byte size, must be positive", e);
    }
}

Prevention

When it happens

Trigger: getPoiExcelMaxFileSize (called from maxFileSize/maxBytesForEntry and the POI read path) encounters poi_excel_max_file_size <= 0 in plugin_config, e.g. 0, -1, or a negative expression result.

Common situations: Trying to 'disable' the limit by setting it to 0; templated configs where the byte value is computed and can go negative; misunderstanding that the option is a ratio or flag rather than a byte size.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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