Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
aede51f
feat: add explicit Volume transfer completion
aakash-saravanan-db Nov 13, 2026
d6706e5
feat: expose Volume completion through native driver adapters
aakash-saravanan-db Nov 13, 2026
b5a9060
fix: validate all Volume instruction rows before transfer
aakash-saravanan-db Nov 13, 2026
845c118
Set the content length of byte uploads
aakash-saravanan-db Nov 13, 2026
3089e1d
Exercise Volume transfer safety on Windows
aakash-saravanan-db Nov 14, 2026
ebf148d
Limit temporary-file builder mutability to Unix
aakash-saravanan-db Nov 14, 2026
861bb69
Preserve Volume transfer timeout and error behavior
aakash-saravanan-db Nov 14, 2026
cc5bac6
Retry transient Volume storage failures safely
aakash-saravanan-db Nov 14, 2026
4f0b3da
Identify Volume storage HTTP errors
aakash-saravanan-db Nov 14, 2026
072bc24
Preserve Volume download inactivity limits and storage error origin
aakash-saravanan-db Nov 14, 2026
243858a
fix(volume): preserve cancellation and storage error contracts
aakash-saravanan-db Nov 14, 2026
9a4ec13
fix(volume): avoid replaying timed out uploads
aakash-saravanan-db Nov 14, 2026
0ad177d
fix(volume): apply configured storage connection timeout
aakash-saravanan-db Nov 15, 2026
c0c4b68
fix(volume): avoid premature upload response timeouts
aakash-saravanan-db Nov 15, 2026
7e90c32
docs(volume): clarify timeout scope
aakash-saravanan-db Nov 15, 2026
f7fec30
fix(volume): authorize across independently resolved roots
aakash-saravanan-db Nov 15, 2026
54182af
fix(volume): replay owned upload bytes across redirects
aakash-saravanan-db Nov 15, 2026
499ae02
fix(volume): keep result stream close local
aakash-saravanan-db Nov 15, 2026
67e1bff
fix(volume): replay file bodies across storage redirects
aakash-saravanan-db Nov 15, 2026
de55bbc
fix(volume): clear redirect referer on HTTPS downgrade
aakash-saravanan-db Nov 15, 2026
9500d2d
fix(volume): preserve write-only download destinations
aakash-saravanan-db Nov 16, 2026
f81eb19
fix(volume): omit signed queries from redirect referers
aakash-saravanan-db Nov 16, 2026
614d2b9
Clarify Volume completion ordering
aakash-saravanan-db Nov 16, 2026
91b8df0
Release session resources when sync NAPI statements close
aakash-saravanan-db Nov 16, 2026
b23abde
fix(napi): release busy results after async owner close
aakash-saravanan-db Nov 16, 2026
ff89c47
fix(volume): record instruction reader failures in telemetry
aakash-saravanan-db Nov 16, 2026
215cd6b
test(volume): verify default and overridden storage deadlines
aakash-saravanan-db Nov 16, 2026
6f13979
fix(volume): skip leading empty instruction batches
aakash-saravanan-db Nov 16, 2026
36b2e69
perf(volume): retain owned upload bytes across retries
aakash-saravanan-db Nov 17, 2026
8a6edeb
fix(volume): preserve storage errors and instruction batches
aakash-saravanan-db Nov 17, 2026
6f1b2da
docs: clarify Volume path and API contracts
aakash-saravanan-db Nov 17, 2026
f371b00
fix(volume): strip credentials when redirect schemes differ
aakash-saravanan-db Nov 17, 2026
0263b1e
fix(volume): replace computed upload lengths
aakash-saravanan-db Nov 17, 2026
2eefa41
docs: clarify cached Volume marker lifetime
aakash-saravanan-db Nov 17, 2026
22b948b
docs: describe buffered result outcomes precisely
aakash-saravanan-db Nov 17, 2026
ae98958
fix(volume): finalize terminal completion error telemetry
aakash-saravanan-db Nov 17, 2026
973e4bb
fix(volume): overwrite writable files in restricted directories
aakash-saravanan-db Nov 18, 2026
7df0f4d
fix(volume): bound normalized symlink resolution
aakash-saravanan-db Nov 18, 2026
0d8395d
refactor(volume): use typed completion and cancellation tokens
aakash-saravanan-db Nov 19, 2026
6121e87
docs(volume): clarify publication and input handshakes
aakash-saravanan-db Nov 19, 2026
85c7446
fix(volume): preserve rows and reject redirect downgrades
aakash-saravanan-db Nov 19, 2026
2f765a9
docs(volume): clarify replacement metadata
aakash-saravanan-db Nov 19, 2026
8095194
fix(volume): publish downloads through the destination file
aakash-saravanan-db Nov 19, 2026
1748e2d
fix(volume): move file work off the async runtime
aakash-saravanan-db Nov 19, 2026
49e36ef
fix(volume): bound idle transfers and preserve completion diagnostics
aakash-saravanan-db Nov 20, 2026
0b19817
fixup! fix(volume): bound idle transfers and preserve completion diag…
aakash-saravanan-db Nov 20, 2026
40bab44
fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
f41140c
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
28006b2
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
9066fed
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
f00cd91
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
b1dedde
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
97a8f26
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 21, 2026
f58a73c
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 22, 2026
724411e
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 22, 2026
5e7a9b2
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 23, 2026
c0694d8
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 23, 2026
fe7d755
fix(volume): classify instructions and log transfer attempts
aakash-saravanan-db Nov 24, 2026
9934c0e
refactor(volume): extract transfer preparation and response handling
aakash-saravanan-db Nov 24, 2026
6d664a8
fix(ci): use public package proxy for Windows Volume tests
aakash-saravanan-db Nov 24, 2026
3dbd1f0
fix(deps): update rustix to 1.1.6
aakash-saravanan-db Nov 24, 2026
dd6ab2a
docs(volume): clarify transfer lifetime and redirect memory
aakash-saravanan-db Nov 24, 2026
088cb40
fix(volume): retain transfer docs and bound cancellation test
aakash-saravanan-db Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ jobs:
# a live workspace; `rust-e2e.yml` runs them separately.
run: cargo test --workspace

volume-windows:
name: Volume tests (Windows)
runs-on:
group: databricks-protected-runner-group
labels: [windows-server-latest]
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: ./.github/actions/setup-public-package-proxies
with:
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
cargo: "true"

- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: stable

- name: Set up MSVC environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
with:
arch: x64

- name: Volume file and cancellation tests
shell: pwsh
run: cargo test --locked --lib volume::tests

c-abi:
name: C ABI smoke test
runs-on:
Expand Down
3 changes: 2 additions & 1 deletion CONNECTION_PARAMETERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ until implemented) and `External` (a caller-supplied `TokenProvider`).

| Field | Description | Default |
|-------|-------------|---------|
| `request_timeout` | Per-request timeout (connect + body). | `120s` |
| `request_timeout` | Per-request timeout (connect + body) for SQL requests. Volume file transfers are limited by storage_read_timeout instead. | `120s` |
| `storage_read_timeout` | Idle limit for Volume file transfers: a transfer fails after this long without progress. | `None` (no limit) |
| `overall_timeout` | Maximum total time across retries for one logical RPC. | `900s` |
| `pool_max_idle_per_host` | Connection-pool size (max idle warm sockets per host). Raise for bursty concurrent workloads. | `100` |
| `retry_min_wait` | Minimum backoff between retries; also the floor for a server `Retry-After` and the base of exponential backoff (`min_wait × 2^attempt`). | `1s` |
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ moka = { version = "0.12.16", features = ["future"] }

# Async utilities
futures = "0.3"
tokio-util = "0.7"
tokio-util = { version = "0.7", features = ["io"] }
async-trait = "0.1"

# Temporary file that holds a Volume GET download before it is copied into place
tempfile = "3"

# Error handling
thiserror = "2"

Expand Down Expand Up @@ -162,7 +165,6 @@ pkcs8 = { version = "0.10", features = ["encryption", "pem", "std"] }
[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util"] }
wiremock = "0.6"
tempfile = "3"
log = "0.4"
# Generate JWT test keys in-process to avoid PEM fixtures and an external
# `openssl` dependency. `ring` already backs runtime JWT signing.
Expand Down
9 changes: 9 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ changes go in their respective binding's NEXT_CHANGELOG.

### Added

- Volume `PUT`, `GET` and `REMOVE`: `ResultStream::complete_volume_operation`
runs the file transfer. Local paths, and the files they resolve to through
symlinks, must be inside the caller's allowed directories. A `PUT` can also
upload bytes the caller supplies.

### Changed

- Adds public fields to `Error` and `ResultManifest`. Code that builds these
structs with struct literals must be updated. Supported consumers are the PyO3,
NAPI, C ABI and ADBC bindings.

### Updated

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Project URL: https://github.com/serde-rs/json
Copyright: Copyright serde_json Authors.


Package: tempfile
Project URL: https://github.com/Stebalien/tempfile
Copyright: Copyright (c) 2015 Steven Allen


Package: thiserror
Project URL: https://github.com/dtolnay/thiserror
Copyright: Copyright thiserror Authors.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ and security vulnerabilities should be reported according to
[SECURITY.md](SECURITY.md). For other project questions, contact
[eng-oss-sql-driver@databricks.com](mailto:eng-oss-sql-driver@databricks.com).

## Volume file operations

For a Volume `PUT`, `GET` or `REMOVE`, call
`ResultStream::complete_volume_operation` before reading rows. It runs the
file transfer; without it the result is only the server's instruction row.
See [`ResultStream::complete_volume_operation`](https://docs.rs/databricks-sql-kernel/latest/databricks_sql_kernel/struct.ResultStream.html#method.complete_volume_operation)
for transfer behavior.

## License

Apache 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
7 changes: 5 additions & 2 deletions adbc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions adbc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ serde_json = "1"
tokio = { version = "1", features = ["rt-multi-thread"] }

[dev-dependencies]
arrow-ipc = "59"
base64 = "0.22"
adbc_driver_manager = "0.24"
wiremock = "0.6"

Expand Down
5 changes: 5 additions & 0 deletions adbc/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Project URL: https://github.com/serde-rs/json
Copyright: Copyright serde_json Authors.


Package: tempfile
Project URL: https://github.com/Stebalien/tempfile
Copyright: Copyright (c) 2015 Steven Allen


Package: thiserror
Project URL: https://github.com/dtolnay/thiserror
Copyright: Copyright thiserror Authors.
Expand Down
14 changes: 14 additions & 0 deletions adbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ optional C interface and native Rust asynchronous submission and polling.
Transactions, partitioned execution, statistics, and progress reporting are
not currently implemented.

## Volume file operations

Set `adbc.databricks.statement.staging_allowed_local_paths` to a JSON array of
local directories to run the file transfer for Volume `PUT`, `GET` and `REMOVE`
before results are returned. The result rows stay readable. Without the option
no file moves and the result is only the server's instruction row.
The option remains enabled for the statement until set to JSON `null`; an empty
array still permits REMOVE while denying file PUT and GET. Local `..` components collapse
before symlink resolution. REMOVE of a missing object succeeds. Input-stream PUT is unsupported.
The client timeout ends at the terminal SQL status and does not bound Volume transfers.
`SocketTimeout` (milliseconds) also sets the idle limit for Volume transfers;
`adbc.databricks.http_request_timeout` sets only the SQL request deadline.
See the kernel [Volume file operations](../README.md#volume-file-operations).

## Compatibility and status

The current implementation targets Rust 1.89+, Rust edition 2021, ADBC 1.1,
Expand Down
11 changes: 10 additions & 1 deletion adbc/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,11 @@ impl DatabaseConfig {
"adbc.databricks.http_request_timeout" => {
self.http.request_timeout = duration_seconds(value, key)?
}
"SocketTimeout" => self.http.request_timeout = duration(value, key, false)?,
"SocketTimeout" => {
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
let timeout = duration(value, key, false)?;
self.http.request_timeout = timeout;
self.http.storage_read_timeout = Some(timeout);
}
_ if key.starts_with(HTTP_PREFIX) => self.set_http(key, value)?,
_ if key.starts_with(PROXY_PREFIX) => self.set_proxy(key, value)?,
_ if key.starts_with(TLS_PREFIX) => self.set_tls(key, value)?,
Expand Down Expand Up @@ -1695,6 +1699,7 @@ mod tests {
#[test]
fn http_pool_and_custom_headers_reach_kernel_config() {
let mut config = DatabaseConfig::default();
set(&mut config, "SocketTimeout", 4500_i64);
set(&mut config, HOST, "https://example.databricks.com");
set(&mut config, HTTP_PATH, "/sql/1.0/warehouses/warehouse-id");
set(&mut config, ACCESS_TOKEN, "sentinel-token");
Expand All @@ -1712,6 +1717,10 @@ mod tests {

let resolved = config.resolve().unwrap();
assert_eq!(resolved.http.pool_max_idle_per_host, 37);
assert_eq!(
resolved.http.storage_read_timeout,
Some(Duration::from_millis(4500))
);
assert_eq!(
resolved.user_agent_entry.as_deref(),
Some("partner+product")
Expand Down
25 changes: 24 additions & 1 deletion adbc/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ pub(crate) fn map_kernel_error(source: kernel::Error) -> Error {
mapped.details = source
.error_code
.map(|code| vec![("databricks.error_code".to_string(), code.into_bytes())]);
if let Some(local) = source.local_error {
let details = mapped.details.get_or_insert_default();
details.push((
"databricks.local_error_kind".into(),
format!("{:?}", local.kind).into_bytes(),
));
details.push(("databricks.local_path".into(), local.path.into_bytes()));
if let Some(errno) = local.raw_os_error {
details.push((
"databricks.local_os_error".into(),
errno.to_string().into_bytes(),
));
}
}
mapped
}

Expand Down Expand Up @@ -101,14 +115,23 @@ mod tests {
kernel::Error::sql_error()
.message("bad query")
.with_sql_state("42000")
.with_vendor_code(42),
.with_vendor_code(42)
.with_local_error(kernel::LocalFileError::new(
Some(2),
std::io::ErrorKind::NotFound,
"/allowed/missing",
)),
);
assert_eq!(mapped.status, Status::InvalidData);
assert_eq!(mapped.vendor_code, 42);
assert_eq!(
mapped.sqlstate,
(*b"42000").map(|byte| byte as std::ffi::c_char)
);
assert!(mapped
.details
.unwrap()
.contains(&("databricks.local_path".into(), b"/allowed/missing".to_vec())));
}

#[test]
Expand Down
4 changes: 4 additions & 0 deletions adbc/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ pub(crate) struct SequenceReader {
base_spec: kernel::StatementSpec,
parameter_style: ParameterStyle,
client_timeout: Option<Duration>,
volume_options: Option<kernel::VolumeOptions>,
rows: BoundRows,
current: Option<kernel::ExecutedStatement>,
schema: SchemaRef,
Expand All @@ -476,6 +477,7 @@ impl SequenceReader {
base_spec: kernel::StatementSpec,
parameter_style: ParameterStyle,
client_timeout: Option<Duration>,
volume_options: Option<kernel::VolumeOptions>,
rows: BoundRows,
executed: kernel::ExecutedStatement,
connection_operation: OperationGuard,
Expand All @@ -489,6 +491,7 @@ impl SequenceReader {
base_spec,
parameter_style,
client_timeout,
volume_options,
rows,
current: Some(executed),
schema,
Expand Down Expand Up @@ -582,6 +585,7 @@ impl Iterator for SequenceReader {
&row,
self.parameter_style,
self.client_timeout,
self.volume_options.as_ref(),
) {
Ok(executed) => executed,
Err(source) => return self.fail(ArrowError::ExternalError(Box::new(source))),
Expand Down
Loading
Loading