{"record":{"id":"f01ae7b1cb2769c1","repo":"apache/iceberg","slug":"cannot-copy-indexeddatafile-wrapper","errorCode":null,"errorMessage":"Cannot copy IndexedDataFile wrapper","messagePattern":"Cannot copy IndexedDataFile wrapper","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/V2Metadata.java","lineNumber":581,"sourceCode":"\n    @Override\n    public Integer sortOrderId() {\n      return wrapped.sortOrderId();\n    }\n\n    @Override\n    public Long dataSequenceNumber() {\n      return wrapped.dataSequenceNumber();\n    }\n\n    @Override\n    public Long fileSequenceNumber() {\n      return wrapped.fileSequenceNumber();\n    }\n\n    @Override\n    public F copy() {\n      throw new UnsupportedOperationException(\"Cannot copy IndexedDataFile wrapper\");\n    }\n\n    @Override\n    public F copyWithStats(Set<Integer> requestedColumnIds) {\n      throw new UnsupportedOperationException(\"Cannot copy IndexedDataFile wrapper\");\n    }\n\n    @Override\n    public F copyWithoutStats() {\n      throw new UnsupportedOperationException(\"Cannot copy IndexedDataFile wrapper\");\n    }\n  }\n\n  private static void checkContentType(ManifestContent content) {\n    Preconditions.checkArgument(\n        content == ManifestContent.DATA || content == ManifestContent.DELETES,\n        \"Unsupported manifest content type for v2: %s\",\n        content);","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/V2Metadata.java#L563-L599","documentation":"Guard on V2Metadata.IndexedDataFile.copy: this wrapper lazily derives sequence-number columns when reading v1 manifests as v2, so it has no standalone copy semantics. Both copy() and copyWithStats() refuse; the wrapped ContentFile must be used to obtain copies with truncated or full stats.","triggerScenarios":"Thrown at core/src/main/java/org/apache/iceberg/V2Metadata.java:581 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call copy()/copyWithStats() on the wrapped ContentFile instead of the wrapper","Avoid holding wrappers beyond the read loop; materialize needed data before discarding","Refactor the caller to operate on the underlying file object"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}