[Rust] Add support to fetch schema from UC for dynamic proto - #704
Open
andrijast-db wants to merge 4 commits into
Open
[Rust] Add support to fetch schema from UC for dynamic proto#704andrijast-db wants to merge 4 commits into
andrijast-db wants to merge 4 commits into
Conversation
andrijast-db
force-pushed
the
andrijast-db/effort/rust-dynamic-proto-fetch-from-uc
branch
from
August 10, 2026 15:02
ba4fc6b to
7593a4b
Compare
andrijast-db
force-pushed
the
andrijast-db/effort/rust-dynamic-proto-fetch-from-uc
branch
from
August 17, 2026 13:20
8d4f9de to
3f7dfc8
Compare
andrijast-db
force-pushed
the
andrijast-db/effort/rust-dynamic-proto-fetch-from-uc
branch
from
August 18, 2026 13:25
8f9f80a to
cc9a56c
Compare
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.
What changes are proposed in this pull request?
Follow-up to #465, closing #521. Adds the ability to fetch a table's schema from Unity Catalog and use it as a dynamic-proto descriptor, so the descriptor no longer has to be built column-by-column in code.
New public API (all additive):
let descriptor = sdk.fetch_message_descriptor("catalog.schema.table", client_id, client_secret).await?;
let stream = sdk.stream_builder().table("catalog.schema.table")
.oauth(client_id, client_secret).dynamic_proto(descriptor).build().await?;
The fetch is a separate step feeding the existing .dynamic_proto(...) — rather than a new builder method that fetches inside build() — so .dynamic_proto() stays the single format selector, network I/O stays visible, and one descriptor can be reused across streams. It mints a plain all-apis token (the ingestion token DefaultTokenFactory produces is rejected by the UC REST API), bounds response body size, classifies transport/5xx/429 as retryable, and rejects credential-bearing URLs. No FFI/wrapper changes.
How is this tested?
Full cargo test --workspace passing; clippy (--all --all-features -D warnings) and fmt clean. Unit tests cover validation, endpoint/URL handling, and descriptor conversion; 20 integration tests run against a loopback HTTP mock covering the happy path, request shapes, and error classification (4xx/5xx/429, unparseable/oversized body, dropped connection). Not tested against a live workspace.