{"record":{"id":"da1d3bfec12d50a5","repo":"apache/iceberg","slug":"retailall-is-not-supported","errorCode":null,"errorMessage":"retailAll is not supported","messagePattern":"retailAll is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/util/StructLikeSet.java","lineNumber":135,"sourceCode":"  public boolean containsAll(Collection<?> objects) {\n    if (objects != null) {\n      return Iterables.all(objects, this::contains);\n    }\n    return false;\n  }\n\n  @Override\n  public boolean addAll(Collection<? extends StructLike> structs) {\n    if (structs != null) {\n      return Iterables.addAll(\n          wrapperSet, Iterables.transform(structs, struct -> wrappers.get().copyFor(struct)));\n    }\n    return false;\n  }\n\n  @Override\n  public boolean retainAll(Collection<?> objects) {\n    throw new UnsupportedOperationException(\"retailAll is not supported\");\n  }\n\n  @Override\n  public boolean removeAll(Collection<?> objects) {\n    boolean changed = false;\n    if (objects != null) {\n      for (Object object : objects) {\n        changed |= remove(object);\n      }\n    }\n    return changed;\n  }\n\n  @Override\n  public void clear() {\n    wrapperSet.clear();\n  }\n","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/util/StructLikeSet.java#L117-L153","documentation":"StructLikeSet.retainAll is not implemented; the set throws UnsupportedOperationException with a message containing a typo ('retailAll'). Any attempt to keep only the elements present in the given collection fails immediately.","triggerScenarios":"Calling set.retainAll(otherCollection) on a StructLikeSet to intersect it in place.","commonSituations":"Set-intersection logic ported from HashSet-based code; deduplicating rows by keeping only known keys.","solutions":["Build the intersection manually: iterate the set, remove elements not in the other collection (set.removeIf(o -> !objects.contains(o)))","Create a new StructLikeSet containing only elements present in both sets","Use StructLikeSet.create(spec/type) plus a loop with contains() checks"],"exampleFix":"// before\nset.retainAll(keepKeys);\n// after\nset.removeIf(key -> !keepKeys.contains(key));","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid retainAll on StructLikeSet; use removeIf or manual intersection","Check the Set implementation before calling bulk mutation methods","Build a plain HashSet if full Collection mutation semantics are needed","Note the typo'd message ('retailAll') when grepping logs"],"tags":["unsupported-operation","set"],"backgroundTag":"unsupported-operation","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"}