From ada67c533da0e9b7dbd0b818c4d518b8722de658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Wed, 22 Jan 2025 12:45:04 +0100 Subject: [PATCH] Suffix S3 path with separator for recursive delete Without trailing path separator the recursive delete operation fails for directory buckets (e.g. S3 Express) --- .../exchange/filesystem/s3/S3FileSystemExchangeStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java index 4eddb0030859..8bd9d5bc7909 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java @@ -360,7 +360,7 @@ private ListObjectsV2Publisher listObjectsRecursively(URI dir) ListObjectsV2Request request = ListObjectsV2Request.builder() .bucket(getBucketName(dir)) - .prefix(keyFromUri(dir)) + .prefix(keyFromUri(dir) + PATH_SEPARATOR) .build(); return s3AsyncClient.listObjectsV2Paginator(request);