diff --git a/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3OutputFile.java b/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3OutputFile.java index d7af4fb965cd..a748ef874e2b 100644 --- a/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3OutputFile.java +++ b/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3OutputFile.java @@ -71,10 +71,10 @@ public void createExclusive(byte[] data) @Override public OutputStream create(AggregatedMemoryContext memoryContext) { - return create(memoryContext, context.exclusiveWriteSupported()); + return create(memoryContext, false); } - public OutputStream create(AggregatedMemoryContext memoryContext, boolean exclusive) + private OutputStream create(AggregatedMemoryContext memoryContext, boolean exclusive) { return new S3OutputStream(memoryContext, uploadExecutor, client, context, location, exclusive, key); } diff --git a/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/AbstractTestS3FileSystem.java b/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/AbstractTestS3FileSystem.java index ca72e134a5a5..4aca5aa20a0b 100644 --- a/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/AbstractTestS3FileSystem.java +++ b/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/AbstractTestS3FileSystem.java @@ -94,6 +94,12 @@ protected final Location getRootLocation() return Location.of("s3://%s/".formatted(bucket())); } + @Override + protected boolean isCreateExclusive() + { + return false; + } + @Override protected final boolean supportsRenameFile() { diff --git a/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/TestS3FileSystemS3Mock.java b/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/TestS3FileSystemS3Mock.java index 9907214a0ea7..ddbabde6a502 100644 --- a/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/TestS3FileSystemS3Mock.java +++ b/lib/trino-filesystem-s3/src/test/java/io/trino/filesystem/s3/TestS3FileSystemS3Mock.java @@ -38,12 +38,6 @@ public class TestS3FileSystemS3Mock private static final S3MockContainer S3_MOCK = new S3MockContainer("3.0.1") .withInitialBuckets(BUCKET); - @Override - protected boolean isCreateExclusive() - { - return false; // not supported by s3-mock - } - @Override protected boolean supportsCreateExclusive() { diff --git a/lib/trino-filesystem/src/main/java/io/trino/filesystem/TrinoOutputFile.java b/lib/trino-filesystem/src/main/java/io/trino/filesystem/TrinoOutputFile.java index a842ed9c030a..8750dfe5b884 100644 --- a/lib/trino-filesystem/src/main/java/io/trino/filesystem/TrinoOutputFile.java +++ b/lib/trino-filesystem/src/main/java/io/trino/filesystem/TrinoOutputFile.java @@ -62,7 +62,7 @@ default void createExclusive(byte[] data) *
* If the file already exists, the method may fail or the file may be overwritten, * depending on the file system implementation. - * For example, S3 does not support creating files exclusively, and performing an + * For example, S3 used not to support creating files exclusively, and performing an * existence check before creating the file is both expensive and unnecessary for * locations that are expected to be unique. *