{"record":{"id":"295c85651ddde1df","repo":"apache/beam","slug":"support-for-move-options-is-not-yet-implemented-s3filesystem","errorCode":null,"errorMessage":"Support for move options is not yet implemented.","messagePattern":"Support for move options is not yet implemented\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java","lineNumber":592,"sourceCode":"\n    CompleteMultipartUploadRequest completeUploadRequest =\n        CompleteMultipartUploadRequest.builder()\n            .bucket(destinationPath.getBucket())\n            .key(destinationPath.getKey())\n            .uploadId(uploadId)\n            .multipartUpload(completedMultipartUpload)\n            .build();\n    return s3Client.get().completeMultipartUpload(completeUploadRequest);\n  }\n\n  @Override\n  protected void rename(\n      List<S3ResourceId> sourceResourceIds,\n      List<S3ResourceId> destinationResourceIds,\n      MoveOptions... moveOptions)\n      throws IOException {\n    if (moveOptions.length > 0) {\n      throw new UnsupportedOperationException(\"Support for move options is not yet implemented.\");\n    }\n    copy(sourceResourceIds, destinationResourceIds);\n    delete(sourceResourceIds);\n  }\n\n  @Override\n  protected void delete(Collection<S3ResourceId> resourceIds) throws IOException {\n    List<S3ResourceId> nonDirectoryPaths =\n        resourceIds.stream()\n            .filter(s3ResourceId -> !s3ResourceId.isDirectory())\n            .collect(Collectors.toList());\n    Multimap<String, String> keysByBucket = ArrayListMultimap.create();\n    nonDirectoryPaths.forEach(path -> keysByBucket.put(path.getBucket(), path.getKey()));\n\n    Stream.Builder<Callable<Void>> tasks = Stream.builder();\n    keysByBucket\n        .keySet()\n        .forEach(","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java#L574-L610","documentation":"S3FileSystem.rename implements the Beam FileSystem rename operation as copy + delete, and does not support any MoveOptions (such as SKIP/IGNORE on destination collisions). If any moveOptions are passed it throws UnsupportedOperationException immediately, before performing the copy.","triggerScenarios":"Calling FileSystems.rename(...) with one or more MoveOptions on an S3-backed path; Beam internals passing MoveOptions.RENAME_SINGLE_CASE_MATCHING or similar when the destination filesystem is S3FileSystem.","commonSituations":"Pipelines performing case-only renames on case-insensitive S3 buckets; frameworks invoking rename with collision-handling options on S3.","solutions":["Call rename without any MoveOptions arguments","Implement the move manually: call FileSystems.copy(...) then FileSystems.delete(...) with your own collision handling","Upgrade Beam, as newer versions may add MoveOptions support to S3FileSystem"],"exampleFix":"// before\nFileSystems.rename(src, dst, MoveOptions.RENAME_SINGLE_CASE_MATCHING);\n// after\nFileSystems.copy(Collections.singletonList(src), Collections.singletonList(dst));\nFileSystems.delete(Collections.singletonList(src));","handlingStrategy":"validation","validationCode":"if (moveOptions.length > 0) throw new IllegalArgumentException(\"S3FileSystem.rename does not support MoveOptions\");","typeGuard":null,"tryCatchPattern":"try { FileSystems.rename(src, dst, options...); } catch (UnsupportedOperationException e) { FileSystems.copy(...); FileSystems.delete(...); }","preventionTips":["Call rename with no varargs MoveOptions on S3-backed filesystems","Implement case-only renames manually with copy+delete","Check FileSystem implementation capabilities before passing options"],"tags":["java","s3","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}