{"record":{"id":"01552a9e92a428f4","repo":"apache/seatunnel","slug":"field-name-s-not-found-in-row-type-s","errorCode":null,"errorMessage":"Field name %s not found in row type %s","messagePattern":"Field name (.+?) not found in row type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java","lineNumber":78,"sourceCode":"            SeaTunnelRowType rowType,\n            List<AssertFieldRule> assertFieldRules) {\n        return assertFieldRules.stream()\n                .filter(assertFieldRule -> !pass(rowData, rowType, assertFieldRule))\n                .findFirst();\n    }\n\n    private boolean pass(\n            SeaTunnelRow rowData, SeaTunnelRowType rowType, AssertFieldRule assertFieldRule) {\n        if (Objects.isNull(rowData)) {\n            return Boolean.FALSE;\n        }\n        int index =\n                Iterables.indexOf(\n                        Lists.newArrayList(rowType.getFieldNames()),\n                        fieldName -> fieldName.equals(assertFieldRule.getFieldName()));\n\n        if (index == -1) {\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Field name %s not found in row type %s\",\n                            assertFieldRule.getFieldName(), rowType));\n        }\n\n        SeaTunnelDataType<?> type = rowType.getFieldType(index);\n        Object value = rowData.getField(index);\n        String fieldName = rowType.getFieldName(index);\n        Boolean typeChecked = checkType(value, assertFieldRule.getFieldType());\n        if (Boolean.FALSE.equals(typeChecked)) {\n            return Boolean.FALSE;\n        }\n        Boolean valueChecked = checkValue(value, type, assertFieldRule.getFieldRules(), fieldName);\n        if (Boolean.FALSE.equals(valueChecked)) {\n            return Boolean.FALSE;\n        }\n        return Boolean.TRUE;\n    }","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java#L60-L96","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Correct field_name in the assert rule to match an actual column in the row type","Print/inspect the upstream schema (catalog table) to confirm column names","Match column name casing exactly, as comparison is case-sensitive via equals","Update transform/source config so the asserted field is produced"],"exampleFix":"// before\nAssertFieldRule {\n  field_name = \"user_id\"\n}\n// after\nAssertFieldRule {\n  field_name = \"userId\"  // must match actual column name in row type\n}","handlingStrategy":"validation","validationCode":"// before running assert\nif (!rowType.getFieldNames().contains(rule.getFieldName())) {\n    throw new IllegalArgumentException(\"field \" + rule.getFieldName() + \" not in \" + rowType.getFieldNames());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive field_name values from the printed catalog table schema, not memory","Keep assert rules in sync with upstream schema changes","Watch for case-sensitivity between rule and column names"],"tags":["assert","schema","field-name"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}