From f7a25a1d5c997de24246b17c4269c7f06fd6136e Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Wed, 2 Oct 2024 21:38:25 +0200 Subject: [PATCH] Do not retrieve Blob metadata on batch delete --- .../src/main/java/io/trino/filesystem/gcs/GcsFileSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsFileSystem.java b/lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsFileSystem.java index 7fc9884c01d9..03940719aa1c 100644 --- a/lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsFileSystem.java +++ b/lib/trino-filesystem-gcs/src/main/java/io/trino/filesystem/gcs/GcsFileSystem.java @@ -169,8 +169,8 @@ public void deleteFiles(Collection locations) for (List locationBatch : partition(locations, batchSize)) { StorageBatch batch = storage.batch(); for (Location location : locationBatch) { - getBlob(storage, new GcsLocation(location)) - .ifPresent(blob -> batch.delete(blob.getBlobId())); + GcsLocation gcsLocation = new GcsLocation(location); + batch.delete(BlobId.of(gcsLocation.bucket(), gcsLocation.path())); } batchFutures.add(executorService.submit(batch::submit)); }