Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
11f321e
feat: add explicit Volume transfer completion
aakash-saravanan-db Nov 13, 2026
e88a8ca
feat: expose Volume completion through native driver adapters
aakash-saravanan-db Nov 13, 2026
6ed382c
fix: validate all Volume instruction rows before transfer
aakash-saravanan-db Nov 13, 2026
3537355
Set the content length of byte uploads
aakash-saravanan-db Nov 13, 2026
f7ce55b
Exercise Volume transfer safety on Windows
aakash-saravanan-db Nov 14, 2026
6102a56
Limit temporary-file builder mutability to Unix
aakash-saravanan-db Nov 14, 2026
e4d9a45
Preserve Volume transfer timeout and error behavior
aakash-saravanan-db Nov 14, 2026
0c802d7
Retry transient Volume storage failures safely
aakash-saravanan-db Nov 14, 2026
2df06d1
Identify Volume storage HTTP errors
aakash-saravanan-db Nov 14, 2026
a4f1242
Preserve Volume download inactivity limits and storage error origin
aakash-saravanan-db Nov 14, 2026
53a1e79
fix(volume): preserve cancellation and storage error contracts
aakash-saravanan-db Nov 14, 2026
f64d706
fix(volume): avoid replaying timed out uploads
aakash-saravanan-db Nov 14, 2026
c0a7759
fix(volume): apply configured storage connection timeout
aakash-saravanan-db Nov 15, 2026
6bb5277
fix(volume): avoid premature upload response timeouts
aakash-saravanan-db Nov 15, 2026
74175d0
docs(volume): clarify timeout scope
aakash-saravanan-db Nov 15, 2026
3c39d7c
fix(volume): authorize across independently resolved roots
aakash-saravanan-db Nov 15, 2026
c374119
fix(volume): replay owned upload bytes across redirects
aakash-saravanan-db Nov 15, 2026
6504514
fix(volume): keep result stream close local
aakash-saravanan-db Nov 15, 2026
840c64d
fix(volume): replay file bodies across storage redirects
aakash-saravanan-db Nov 15, 2026
2407fab
fix(volume): clear redirect referer on HTTPS downgrade
aakash-saravanan-db Nov 15, 2026
14bdf00
fix(volume): preserve write-only download destinations
aakash-saravanan-db Nov 16, 2026
62a33ed
fix(volume): omit signed queries from redirect referers
aakash-saravanan-db Nov 16, 2026
66db001
Clarify Volume completion ordering
aakash-saravanan-db Nov 16, 2026
3bffd02
Release session resources when sync NAPI statements close
aakash-saravanan-db Nov 16, 2026
cb2fdc8
fix(napi): release busy results after async owner close
aakash-saravanan-db Nov 16, 2026
13cf305
fix(volume): record instruction reader failures in telemetry
aakash-saravanan-db Nov 16, 2026
f1304f3
test(volume): verify default and overridden storage deadlines
aakash-saravanan-db Nov 16, 2026
8b75753
fix(volume): skip leading empty instruction batches
aakash-saravanan-db Nov 16, 2026
28ee8c1
perf(volume): retain owned upload bytes across retries
aakash-saravanan-db Nov 17, 2026
bb06153
fix(volume): preserve storage errors and instruction batches
aakash-saravanan-db Nov 17, 2026
f226785
docs: clarify Volume path and API contracts
aakash-saravanan-db Nov 17, 2026
43a98ae
fix(volume): strip credentials when redirect schemes differ
aakash-saravanan-db Nov 17, 2026
45abece
fix(volume): replace computed upload lengths
aakash-saravanan-db Nov 17, 2026
b2651b5
docs: clarify cached Volume marker lifetime
aakash-saravanan-db Nov 17, 2026
1ddfe1d
docs: describe buffered result outcomes precisely
aakash-saravanan-db Nov 17, 2026
409ef86
fix(volume): finalize terminal completion error telemetry
aakash-saravanan-db Nov 17, 2026
7064f54
fix(volume): overwrite writable files in restricted directories
aakash-saravanan-db Nov 18, 2026
28bd650
fix(volume): bound normalized symlink resolution
aakash-saravanan-db Nov 18, 2026
dec7b72
refactor(volume): use typed completion and cancellation tokens
aakash-saravanan-db Nov 19, 2026
7fe16a3
docs(volume): clarify publication and input handshakes
aakash-saravanan-db Nov 19, 2026
1b5aa8b
fix(volume): preserve rows and reject redirect downgrades
aakash-saravanan-db Nov 19, 2026
f6a9f00
docs(volume): clarify replacement metadata
aakash-saravanan-db Nov 19, 2026
fec11ff
fix(volume): publish downloads through the destination file
aakash-saravanan-db Nov 19, 2026
694e6e4
fix(volume): move file work off the async runtime
aakash-saravanan-db Nov 19, 2026
dd837e4
fix(volume): bound idle transfers and preserve completion diagnostics
aakash-saravanan-db Nov 20, 2026
358fb78
fixup! fix(volume): bound idle transfers and preserve completion diag…
aakash-saravanan-db Nov 20, 2026
1e62337
fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
33674cc
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
9325216
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
b7c9f3a
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
bdeba7a
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
f500e27
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 20, 2026
58519b5
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 21, 2026
0309946
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 22, 2026
64f16cd
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 22, 2026
1d86266
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 23, 2026
88bb0ad
fixup! fix(volume): start retries on failure and clear ADBC staging
aakash-saravanan-db Nov 23, 2026
af8ba16
fix(volume): classify instructions and log transfer attempts
aakash-saravanan-db Nov 24, 2026
885fb33
refactor(volume): extract transfer preparation and response handling
aakash-saravanan-db Nov 24, 2026
0ff5161
fix(ci): use public package proxy for Windows Volume tests
aakash-saravanan-db Nov 24, 2026
0c7d35e
fix(deps): update rustix to 1.1.6
aakash-saravanan-db Nov 24, 2026
bfaff27
docs(volume): clarify transfer lifetime and redirect memory
aakash-saravanan-db Nov 24, 2026
617e4c5
fix(volume): retain transfer docs and bound cancellation test
aakash-saravanan-db Nov 26, 2026
a5beb83
fix(volume): cancel async transfers after the parent statement is dro…
aakash-saravanan-db Nov 30, 2026
479a5a9
fix(adbc): fail execute_update on Volume statements without staging r…
aakash-saravanan-db Nov 30, 2026
d9e8ab4
fix(statement): skip the cancel request for closed statements
aakash-saravanan-db Nov 30, 2026
435169e
fix(volume): reject PUT sources that do not report their size
aakash-saravanan-db Nov 30, 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
16 changes: 16 additions & 0 deletions adbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ 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.
`execute_update` returns no rows, so without the option it fails with
`InvalidState` for a Volume statement.
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — Only SocketTimeout also sets storage_read_timeout, while the adbc.databricks.http_request_timeout key sets only request_timeout. The same logical timeout therefore behaves differently by key, and the second key leaves Volume transfers with no idle limit. Make both keys set it, or document the difference.

(Anchored to the nearest changed line — see the description for the exact location.)

🔀 Found by Claude Opus 5.5 · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is closed and the ADBC change now lives in #513, where adbc/README.md documents the difference: SocketTimeout also sets the idle limit for Volume transfers, and adbc.databricks.http_request_timeout sets only the SQL request deadline.

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