{"record":{"id":"4013f3a339339d87","repo":"apache/flink","slug":"pos-4013f3","errorCode":null,"errorMessage":"{pos}","messagePattern":"\\{pos\\}","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"flink-core-api/src/main/java/org/apache/flink/api/java/tuple/Tuple9.java","lineNumber":145,"sourceCode":"                return (T) this.f0;\n            case 1:\n                return (T) this.f1;\n            case 2:\n                return (T) this.f2;\n            case 3:\n                return (T) this.f3;\n            case 4:\n                return (T) this.f4;\n            case 5:\n                return (T) this.f5;\n            case 6:\n                return (T) this.f6;\n            case 7:\n                return (T) this.f7;\n            case 8:\n                return (T) this.f8;\n            default:\n                throw new IndexOutOfBoundsException(String.valueOf(pos));\n        }\n    }\n\n    @Override\n    @SuppressWarnings(\"unchecked\")\n    public <T> void setField(T value, int pos) {\n        switch (pos) {\n            case 0:\n                this.f0 = (T0) value;\n                break;\n            case 1:\n                this.f1 = (T1) value;\n                break;\n            case 2:\n                this.f2 = (T2) value;\n                break;\n            case 3:\n                this.f3 = (T3) value;","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core-api/src/main/java/org/apache/flink/api/java/tuple/Tuple9.java#L127-L163","documentation":"Tuple9.getField(int pos) throws IndexOutOfBoundsException when pos is outside 0..8. Tuple9 is the maximum tuple arity in Flink's Java tuple API, so any ninth-or-higher 0-based index (or a 1-based index of 9) is invalid. The message is the offending position.","triggerScenarios":"getField(9) or a negative index; treating 1-based field numbers (1..9) as 0-based positions; positional loops bounded by another type's arity.","commonSituations":"External schemas with 1-based column numbers; records that outgrew the 9-field tuple limit while positional access code stayed unchanged.","solutions":["Use positions 0..8 for Tuple9.getField","Convert 1-based external indices with `pos - 1` and validate the range","If you need more than 9 fields, use a POJO, case class, or Row instead of tuples","Bounds-check against getArity() before access"],"exampleFix":"// before (oneBasedColumn comes from a 1-based spec)\nObject v = tuple9.getField(oneBasedColumn);\n\n// after\nint pos = oneBasedColumn - 1;\nObject v = (pos >= 0 && pos < tuple9.getArity()) ? tuple9.getField(pos) : null;","handlingStrategy":"validation","validationCode":"int pos = oneBasedIndex - 1; // external specs are often 1-based\nif (pos < 0 || pos >= tuple9.getArity()) {\n    throw new IllegalArgumentException(\"Field \" + oneBasedIndex + \" outside Tuple9\");\n}\nObject v = tuple9.getField(pos);","typeGuard":null,"tryCatchPattern":"catch (IndexOutOfBoundsException e) { /* identify whether a 1-based index leaked through and rethrow */ }","preventionTips":["Tuple9 is the maximum arity — 9 or higher 0-based positions are always invalid","Convert and validate 1-based external indices explicitly","Move to POJO/Row for records beyond 9 fields"],"tags":["tuple","index-out-of-bounds","flink-core-api","validation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}