andrebsguedes commented on code in PR #5681:
URL: https://github.com/apache/arrow-rs/pull/5681#discussion_r1854728752
##########
object_store/src/azure/client.rs:
##########
@@ -380,6 +589,78 @@ impl AzureClient {
Ok(())
}
+ fn build_bulk_delete_body(
+ &self,
+ boundary: &str,
+ paths: &[Path],
+ credential: &Option<Arc<AzureCredential>>,
+ ) -> Vec<u8> {
+ let mut body_bytes = Vec::with_capacity(paths.len() * 2048);
+
+ for (idx, path) in paths.iter().enumerate() {
+ let url = self.config.path_url(path);
+
+ // Build subrequest with proper authorization
+ let request = self
+ .client
+ .request(Method::DELETE, url)
+ .header(CONTENT_LENGTH, HeaderValue::from(0))
+ // Each subrequest must be authorized individually [1] and we
use
+ // the CredentialExt for this.
+ // [1]:
https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch?tabs=microsoft-entra-id#request-body
+ .with_azure_authorization(credential, &self.config.account)
+ .build()
+ .unwrap();
+
+ // Url for part requests must be relative and without base
+ let relative_url =
self.config.service.make_relative(request.url()).unwrap();
+
+ serialize_part_delete_request(&mut body_bytes, boundary, idx,
request, relative_url)
+ }
+
+ // Encode end marker
+ extend(&mut body_bytes, b"--");
+ extend(&mut body_bytes, boundary.as_bytes());
Review Comment:
We can't because the first thing we add to `body_bytes` is the boundary
itself (within `serialize_part_delete_request`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]