[Storage] Photon Proof-of-Concept#4796
Draft
vincenttran-msft wants to merge 3 commits into
Draft
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
| #[tracing::function("Storage.Blob.BlobContainerClient.listBlobFlatSegmentApacheArrow")] | ||
| pub fn list_blob_flat_segment_apache_arrow( | ||
| &self, | ||
| accept: ListBlobsAcceptFormat, |
Member
Author
There was a problem hiding this comment.
We would make this an option bag option, but made it a parameter for now just for ease of refactoring between different accept values since most of the time we don't even use an optioned API call
Comment on lines
+791
to
+808
| let is_arrow = headers | ||
| .get_optional_str(&azure_core::http::headers::CONTENT_TYPE) | ||
| .is_some_and(|content_type| { | ||
| content_type.contains("application/vnd.apache.arrow.stream") | ||
| }); | ||
| // Condition on whether we got back XML or arrow (since you can request arrow but may hit XML fallback) | ||
| let (body, next_marker) = if is_arrow { | ||
| // PROOF-OF-CONCEPT ONLY: This currently decodes arrow then re-encoding to XML to make the return type happy. | ||
| // (re-decoded later in `into_model()`). Therefore this adds a full round-trip, negating the benefits of adding arrow support. | ||
| // Discussion point: How to smooth over the return type issue (Result<Pager<ListBlobsResponse, XmlFormat>>). | ||
| let model = crate::arrow_decode::decode_arrow_list_blobs(&body)?; | ||
| let next_marker = model.next_marker.clone(); | ||
| (xml::to_xml(&model)?, next_marker) | ||
| } else { | ||
| let page: BlobContainerClientListBlobFlatSegmentApacheArrowPage = | ||
| xml::from_xml(&body)?; | ||
| (body.into(), page.next_marker) | ||
| }; |
Member
Author
There was a problem hiding this comment.
This is the conditional logic section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype end-to-end support for receiving the flat blob listing as an Apache Arrow IPC stream, decoding it into the existing
ListBlobsResponsemodel. This proves correctness of the wire format and decode path; it is not yet a performance win (see "What's left").What this covers
BlobContainerClient::list_blob_flat_segment_apache_arrow(accept, options)that exposes anaccept: ListBlobsAcceptFormatenum (Arrow/Auto/Xml).Arrow/Autorequestapplication/vnd.apache.arrow.stream,application/xml;Xmlrequestsapplication/xml. In actuality, we would just implement this change tolist_blobsand make it optional.Content-Type(server-dictated, not the requestAccept), so both an Arrow stream and an XML fallback are handled correctly.src/arrow_decode.rs) — decodes an Arrow IPC stream intoListBlobsResponse: per-rowBlobItem/BlobPropertiesfor a subset of columns (name, timestamps, blob type, etag, content length/type, Content-MD5, access tier, lease state/status, server-encrypted) plusNextMarkerfrom schema metadata.arrow-array,arrow-ipc,arrow-schema(59.1.0).test_list_blobs_observe_rawdumps the raw wire response (viaAuto). Existinglist_blobstests are temporarily pointed at the new method withXmlto confirm the original XML path still works.What's left
XmlFormatpipeline can re-parse it downstream - a full round-trip that is slower than XML. Production ready code needs a realArrowFormatthat decodes Arrow straight into the model with no XML round-trip.Acceptvia options/client (deferred) rather than a required positional argument.generated/and will be overwritten bytsp-client update; the emitter must learn to produce this. (2)ListBlobsAcceptFormat::{Arrow, Auto}map to the sameAcceptstring, makingAutounreachable inFromStr(currently suppressed).list_blobs, and add proper Arrow + XML recordings.Result<Pager<ListBlobsResponse, XmlFormat>>