This is an automated email from the ASF dual-hosted git repository. kgyrtkirk pushed a commit to branch 33.0.0 in repository https://gitbox.apache.org/repos/asf/druid.git
commit 0bb6db27f395be83f97ec85f237db2aa2b4119fa Author: Akshat Jain <[email protected]> AuthorDate: Tue Apr 8 14:18:39 2025 +0530 Fix BlobClient issues because of breaking change wrt URL encoding (#17887) In #17576, we updated the Azure BOM from version 1.2.23 to 1.2.30. This updated the azure-storage-blob package from 12.25.4 to 12.29.0. But, version 12.26.0-beta.1 included a breaking change wrt URL encoding, as can be seen here: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/CHANGELOG.md#12260-beta1-2024-04-15 (cherry picked from commit 772cb47434d5677e243df3d5d06b6975460b09a8) --- .../java/org/apache/druid/storage/azure/AzureStorage.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorage.java b/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorage.java index 011812843f2..b42616f1fd5 100644 --- a/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorage.java +++ b/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorage.java @@ -32,7 +32,6 @@ import com.azure.storage.blob.models.ParallelTransferOptions; import com.azure.storage.blob.options.BlobInputStreamOptions; import com.azure.storage.blob.options.BlockBlobOutputStreamOptions; import com.azure.storage.blob.specialized.BlockBlobClient; -import com.azure.storage.common.Utility; import com.google.common.collect.Lists; import com.google.common.collect.Streams; import org.apache.druid.java.util.common.RE; @@ -158,7 +157,7 @@ public class AzureStorage final BlockBlobClient blockBlobClient = azureClientFactory .getBlobServiceClient(maxAttempts, defaultStorageAccount) .createBlobContainerIfNotExists(containerName) - .getBlobClient(Utility.urlEncode(blobName)) + .getBlobClient(blobName) .getBlockBlobClient(); // TODO based on the usage here, it might be better to overwrite the existing blob instead; that's what StorageConnector#write documents it does @@ -187,7 +186,7 @@ public class AzureStorage return azureClientFactory .getBlobServiceClient(null, defaultStorageAccount) .getBlobContainerClient(containerName) - .getBlobClient(Utility.urlEncode(blobName)) + .getBlobClient(blobName) .getBlockBlobClient() .getProperties() .getBlobSize(); @@ -243,7 +242,7 @@ public class AzureStorage return azureClientFactory .getBlobServiceClient(maxAttempts, defaultStorageAccount) .getBlobContainerClient(containerName) - .getBlobClient(Utility.urlEncode(blobName)) + .getBlobClient(blobName) .openInputStream(new BlobInputStreamOptions().setRange(new BlobRange(offset, length))); } @@ -335,7 +334,7 @@ public class AzureStorage return azureClientFactory .getBlobServiceClient(maxAttempts, defaultStorageAccount) .getBlobContainerClient(container) - .getBlobClient(Utility.urlEncode(blobName)) + .getBlobClient(blobName) .exists(); } @@ -442,7 +441,7 @@ public class AzureStorage blobContainerClient // Creates a blob by default, no need to use a specific blob client. // We also need to urlEncode the path to handle special characters. - .getBlobClient(Utility.urlEncode(blobName)) + .getBlobClient(blobName) // Set overwrite to true to keep behavior more similar to s3Client.putObject. .upload(stream, file.length(), true); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
