{"record":{"id":"9ab8ee474d8487ac","repo":"apache/flink","slug":"invalid-format-of-row-field-expression","errorCode":null,"errorMessage":"Invalid format of Row field expression \"{}\".","messagePattern":"Invalid format of Row field expression \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidFieldReferenceException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/RowTypeInfo.java","lineNumber":179,"sourceCode":"                                    + tail\n                                    + \"\\\" not possible on atomic type \"\n                                    + fieldType\n                                    + \".\");\n                }\n            }\n        }\n    }\n\n    @Override\n    public <X> TypeInformation<X> getTypeAt(String fieldExpression) {\n        Matcher matcher = PATTERN_NESTED_FIELDS.matcher(fieldExpression);\n        if (!matcher.matches()) {\n            if (fieldExpression.equals(ExpressionKeys.SELECT_ALL_CHAR)\n                    || fieldExpression.equals(ExpressionKeys.SELECT_ALL_CHAR_SCALA)) {\n                throw new InvalidFieldReferenceException(\n                        \"Wildcard expressions are not allowed here.\");\n            } else {\n                throw new InvalidFieldReferenceException(\n                        \"Invalid format of Row field expression \\\"\" + fieldExpression + \"\\\".\");\n            }\n        }\n\n        String field = matcher.group(1);\n\n        Matcher intFieldMatcher = PATTERN_INT_FIELD.matcher(field);\n        int fieldIndex;\n        if (intFieldMatcher.matches()) {\n            // field expression is an integer\n            fieldIndex = Integer.valueOf(field);\n        } else {\n            fieldIndex = this.getFieldIndex(field);\n        }\n        // fetch the field type will throw exception if the index is illegal\n        TypeInformation<X> fieldType = this.getTypeAt(fieldIndex);\n\n        String tail = matcher.group(3);","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/RowTypeInfo.java#L161-L197","documentation":"Thrown by RowTypeInfo.getTypeAt(String) when the fieldExpression does not match the Row nested-field regex (integer or string identifier, optionally dotted) and is not a wildcard. The expression is syntactically malformed. This is an InvalidFieldReferenceException.","triggerScenarios":"Calling rowType.getTypeAt(\"\"), getTypeAt(\"field-name\"), getTypeAt(\"f0.\"), or getTypeAt(\"a b\"). The PATTERN_NESTED_FIELDS matcher fails and the expression is not exactly '*' or '_'.","commonSituations":"Passing a malformed string to getTypeAt programmatically, or using POJO-style or tuple-style syntax that doesn't match Row's combined integer+string pattern. Also reached when ExpressionKeys strips a wildcard and leaves an empty remainder.","solutions":["Use a valid Row field expression: integer index, field name (f0 or custom), or dotted nested path.","Avoid empty strings, trailing dots, hyphens, and spaces."],"exampleFix":"// before\nrowType.getTypeAt(\"field-name\");\n// after\nrowType.getTypeAt(\"fieldName\");","handlingStrategy":"validation","validationCode":"private static final Pattern ROW_NESTED =\n    Pattern.compile(\"([0-9]+|[\\\\p{L}_$][\\\\p{L}\\\\p{Digit}_$]*)(\\\\\\.(.+))?\");\n\nvoid validateGetTypeAtExpr(String expr) {\n    if (!ROW_NESTED.matcher(expr).matches()) {\n        throw new IllegalArgumentException(\"Malformed: \" + expr);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate Row field expressions before calling getTypeAt.","Avoid empty strings, trailing dots, and hyphens."],"tags":["row","field-reference","gettypeat","type-system","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}