{"record":{"id":"0b32700f8676f62b","repo":"apache/iceberg","slug":"child-columns-is-null-hence-cannot-find-index","errorCode":null,"errorMessage":"Child columns is null hence cannot find index: ","messagePattern":"Child columns is null hence cannot find index: ","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java","lineNumber":92,"sourceCode":"  }\n\n  public DecimalT getDecimal(int rowId, int precision, int scale) {\n    throw new UnsupportedOperationException(\"Unsupported type: decimal\");\n  }\n\n  public Utf8StringT getUTF8String(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: UTF8String\");\n  }\n\n  public ArrayT getArray(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: array\");\n  }\n\n  public ChildVectorT childColumn(int pos) {\n    if (childColumns != null) {\n      return childColumns[pos];\n    } else {\n      throw new IndexOutOfBoundsException(\"Child columns is null hence cannot find index: \" + pos);\n    }\n  }\n\n  public final ValueVector getVector() {\n    return vector;\n  }\n}\n","sourceCodeStart":74,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java#L74-L100","documentation":"childColumn(pos) indexes into the accessor's child column vectors (the element vectors of a list or fields of a struct). It throws IndexOutOfBoundsException when childColumns is null, meaning this accessor was created without nested child vectors — the column is not nested, so there is no child vector to look up.","triggerScenarios":"Calling childColumn(pos) on an accessor constructed without child columns (non-list/non-struct column), or after a factory path that returns null children for unsupported nested types.","commonSituations":"Assuming list support in vectorized reads and calling childColumn on primitive accessors; vectorized readers built with childColumns omitted (e.g. nested types disabled) while downstream code still requests children.","solutions":["Check childColumn availability (non-null childColumns / list-typed column) before calling","Verify the vectorized reader was built with nested-type support so child columns are populated","Fall back to the non-vectorized read path for nested columns when children are absent"],"exampleFix":"// before\nChildVectorT child = accessor.childColumn(0); // throws if childColumns == null\n// after\nif (accessor.getChildColumns() != null && accessor.getChildColumns().length > 0) {\n  ChildVectorT child = accessor.childColumn(0);\n}","handlingStrategy":"validation","validationCode":"if (accessor.getChildColumns() == null) { throw new IllegalStateException(\"accessor has no child columns\"); }","typeGuard":null,"tryCatchPattern":"try { return accessor.childColumn(pos); } catch (IndexOutOfBoundsException e) { /* recreate accessor with nested support or fall back */ }","preventionTips":["Confirm child columns exist before element-wise access","Ensure the reader is constructed with nested-type support so childColumns are populated","Wrap accessor construction and usage together so configuration mismatches surface early"],"tags":["arrow","index-out-of-bounds","nested-types"],"backgroundTag":"index-out-of-bounds","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}