{"record":{"id":"643c05340cfbf688","repo":"apache/flink","slug":"wildcard-expressions-are-not-allowed-here-643c05","errorCode":null,"errorMessage":"Wildcard expressions are not allowed here.","messagePattern":"Wildcard expressions are not allowed here\\.","errorType":"exception","errorClass":"InvalidFieldReferenceException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/RowTypeInfo.java","lineNumber":176,"sourceCode":"                } else {\n                    throw new InvalidFieldReferenceException(\n                            \"Nested field expression \\\"\"\n                                    + 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","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/RowTypeInfo.java#L158-L194","documentation":"Thrown by RowTypeInfo.getTypeAt(String) when the fieldExpression is exactly '*' or '_'. getTypeAt returns a single field's type, so wildcards are invalid. This is an InvalidFieldReferenceException.","triggerScenarios":"Calling rowType.getTypeAt(\"*\") or rowType.getTypeAt(\"_\"). ExpressionKeys strips wildcards before calling getTypeAt (Keys.java:334-338), so this indicates direct API misuse.","commonSituations":"Programmatic code that forwards the same expression to both getFlatFields and getTypeAt without filtering wildcards. Rare in typical user code.","solutions":["Do not pass '*' or '_' to getTypeAt. Use getFlatFields for wildcard selection.","Filter wildcard expressions before calling getTypeAt."],"exampleFix":"// before\nrowType.getTypeAt(\"*\");\n// after\nrowType.getFlatFields(\"*\");","handlingStrategy":"validation","validationCode":"void safeGetTypeAt(RowTypeInfo type, String expr) {\n    if (\"*\".equals(expr) || \"_\".equals(expr)) {\n        throw new IllegalArgumentException(\n            \"Use getFlatFields for wildcards\");\n    }\n    type.getTypeAt(expr);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not pass wildcards to getTypeAt; use getFlatFields instead."],"tags":["row","wildcard","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"}