apache/seatunnel · error · java.lang.IllegalArgumentException

Operator EXTENSION requires a non-null ConditionExtension

Error message

Operator EXTENSION requires a non-null ConditionExtension

What it means

ExcelReadStrategy.getCellValue converts a POI Cell value based on the cell's CellType. Recognized types (numeric, string, boolean, formula results, etc.) are converted; anything reaching the default branch — e.g. CellType.BLANK, _NONE, or ERROR — throws FileConnectorException with UNSUPPORTED_DATA_TYPE naming the unsupported CellType.

Source

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

        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");
        }
        this.option = option;
        this.operator = operator;
        this.expectValue = expectValue;
        this.compareOption = compareOption;
        this.extension = extension;
    }

    public static <T> Condition<T> of(Option<T> option, T expectValue) {
        return new Condition<>(option, expectValue);
    }

    public static <T> Condition<T> of(Option<T> option, ConditionOperator op, T expectValue) {
        return new Condition<>(option, op, expectValue, null);
    }

    public <E> Condition<T> and(Option<E> option, E expectValue) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Fix the source workbook: remove or correct cells with error values (#DIV/0!, #N/A, #REF!) from the data range.
  2. Preprocess the Excel file to convert error cells to empty strings or sentinel values.
  3. If you control the code, extend getCellValue to map CellType.ERROR/BLANK to null or a default value instead of throwing.

Example fix

// before
cell formula: =1/0   -> CellType.ERROR thrown as unsupported
// after
cell formula: =IFERROR(1/0, "")
Defensive patterns

Strategy: validation

Validate before calling

java
// Before reading, sanitize the workbook: check for error cells in the data range
for (Row row : sheet) {
    for (Cell cell : row) {
        if (cell.getCellType() == CellType.ERROR || cell.getCellType() == CellType._NONE) {
            throw new IllegalStateException("Cell " + cell.getAddress() + " has unsupported type "
                + cell.getCellType() + "; fix the workbook before reading");
        }
    }
}

Type guard

java
static boolean isSupportedCellType(CellType t) {
    return t == CellType.NUMERIC || t == CellType.STRING || t == CellType.BOOLEAN
        || t == CellType.FORMULA;
}

Try / catch

java
try {
    reader.readProcess(split);
} catch (FileConnectorException e) {
    if (e.getMessage().contains("type not support")) {
        LOG.error("Workbook contains unsupported cell type (e.g. #DIV/0!, #N/A) — clean the file", e);
    }
}

Prevention

When it happens

Trigger: readByPoi iterates sheet cells and calls getCellValue with a CellType not handled by the switch, such as CellType.ERROR (a cell containing #DIV/0!, #N/A, etc.) or CellType._NONE/BLANK reaching the converter.

Common situations: Excel sheets containing formula error values (#REF!, #VALUE!) in the data range; corrupted cells; sheets where blank cells are not filtered out before conversion; locale/Excel-specific cell states.

Related errors


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