apache/seatunnel · error · IllegalArgumentException

Field name %s not found in row type %s

Error message

Field name %s not found in row type %s

What it means

AssertExecutor resolves the index of the asserted field name within the row's field names; if the assert rule references a field that does not exist in the row type, Iterables.indexOf returns -1 and this IllegalArgumentException is thrown. It is a fail-fast validation that the assertion rule matches the actual data schema.

Source

Thrown at seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java:78

            SeaTunnelRowType rowType,
            List<AssertFieldRule> assertFieldRules) {
        return assertFieldRules.stream()
                .filter(assertFieldRule -> !pass(rowData, rowType, assertFieldRule))
                .findFirst();
    }

    private boolean pass(
            SeaTunnelRow rowData, SeaTunnelRowType rowType, AssertFieldRule assertFieldRule) {
        if (Objects.isNull(rowData)) {
            return Boolean.FALSE;
        }
        int index =
                Iterables.indexOf(
                        Lists.newArrayList(rowType.getFieldNames()),
                        fieldName -> fieldName.equals(assertFieldRule.getFieldName()));

        if (index == -1) {
            throw new IllegalArgumentException(
                    String.format(
                            "Field name %s not found in row type %s",
                            assertFieldRule.getFieldName(), rowType));
        }

        SeaTunnelDataType<?> type = rowType.getFieldType(index);
        Object value = rowData.getField(index);
        String fieldName = rowType.getFieldName(index);
        Boolean typeChecked = checkType(value, assertFieldRule.getFieldType());
        if (Boolean.FALSE.equals(typeChecked)) {
            return Boolean.FALSE;
        }
        Boolean valueChecked = checkValue(value, type, assertFieldRule.getFieldRules(), fieldName);
        if (Boolean.FALSE.equals(valueChecked)) {
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Correct field_name in the assert rule to match an actual column in the row type
  2. Print/inspect the upstream schema (catalog table) to confirm column names
  3. Match column name casing exactly, as comparison is case-sensitive via equals
  4. Update transform/source config so the asserted field is produced

Example fix

// before
AssertFieldRule {
  field_name = "user_id"
}
// after
AssertFieldRule {
  field_name = "userId"  // must match actual column name in row type
}
Defensive patterns

Strategy: validation

Validate before calling

// before running assert
if (!rowType.getFieldNames().contains(rule.getFieldName())) {
    throw new IllegalArgumentException("field " + rule.getFieldName() + " not in " + rowType.getFieldNames());
}

Prevention

When it happens

Trigger: Configuring an assert rule with field_name that is not a column of the CatalogTable row type being asserted (e.g. wrong column name, renamed column, or asserting on the wrong catalog table).

Common situations: Renaming a column upstream but not in the assert rule; typo in field_name; case mismatch between rule and schema; asserting against a transform output whose schema differs from the source.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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