apache/beam · error · UnsupportedOperationException
Support for move options is not yet implemented.
Error message
Support for move options is not yet implemented.
What it means
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.
Source
Thrown at sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java:592
CompleteMultipartUploadRequest completeUploadRequest =
CompleteMultipartUploadRequest.builder()
.bucket(destinationPath.getBucket())
.key(destinationPath.getKey())
.uploadId(uploadId)
.multipartUpload(completedMultipartUpload)
.build();
return s3Client.get().completeMultipartUpload(completeUploadRequest);
}
@Override
protected void rename(
List<S3ResourceId> sourceResourceIds,
List<S3ResourceId> destinationResourceIds,
MoveOptions... moveOptions)
throws IOException {
if (moveOptions.length > 0) {
throw new UnsupportedOperationException("Support for move options is not yet implemented.");
}
copy(sourceResourceIds, destinationResourceIds);
delete(sourceResourceIds);
}
@Override
protected void delete(Collection<S3ResourceId> resourceIds) throws IOException {
List<S3ResourceId> nonDirectoryPaths =
resourceIds.stream()
.filter(s3ResourceId -> !s3ResourceId.isDirectory())
.collect(Collectors.toList());
Multimap<String, String> keysByBucket = ArrayListMultimap.create();
nonDirectoryPaths.forEach(path -> keysByBucket.put(path.getBucket(), path.getKey()));
Stream.Builder<Callable<Void>> tasks = Stream.builder();
keysByBucket
.keySet()
.forEach(View on GitHub (pinned to 12126d8942)
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
Example fix
// before FileSystems.rename(src, dst, MoveOptions.RENAME_SINGLE_CASE_MATCHING); // after FileSystems.copy(Collections.singletonList(src), Collections.singletonList(dst)); FileSystems.delete(Collections.singletonList(src));
Defensive patterns
Strategy: validation
Validate before calling
if (moveOptions.length > 0) throw new IllegalArgumentException("S3FileSystem.rename does not support MoveOptions"); Try / catch
try { FileSystems.rename(src, dst, options...); } catch (UnsupportedOperationException e) { FileSystems.copy(...); FileSystems.delete(...); } Prevention
- 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
When it happens
Trigger: 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.
Common situations: Pipelines performing case-only renames on case-insensitive S3 buckets; frameworks invoking rename with collision-handling options on S3.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Unexpected StandardResolveOptions [%s]
- Runner does not support draining.
- UnsupportedOperationException
- Must resolve compression into a concrete value before callin
- AUTO is applicable only to reading files
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/295c85651ddde1df.
Report an issue: GitHub.