Skip to content

Commit 06a005a

Browse files
feat(volume): complete Volume file transfers in the kernel core
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent 86d42d0 commit 06a005a

29 files changed

Lines changed: 3473 additions & 78 deletions

‎.github/workflows/pr-checks.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,32 @@ jobs:
131131
# a live workspace; `rust-e2e.yml` runs them separately.
132132
run: cargo test --workspace
133133

134+
volume-windows:
135+
name: Volume tests (Windows)
136+
runs-on:
137+
group: databricks-protected-runner-group
138+
labels: [windows-server-latest]
139+
timeout-minutes: 45
140+
steps:
141+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
142+
143+
- uses: ./.github/actions/setup-public-package-proxies
144+
with:
145+
cargo: "true"
146+
147+
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
148+
with:
149+
toolchain: stable
150+
151+
- name: Set up MSVC environment
152+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
153+
with:
154+
arch: x64
155+
156+
- name: Volume file and cancellation tests
157+
shell: pwsh
158+
run: cargo test --locked --lib volume::tests
159+
134160
c-abi:
135161
name: C ABI smoke test
136162
runs-on:

‎CONNECTION_PARAMETERS.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ until implemented) and `External` (a caller-supplied `TokenProvider`).
127127

128128
| Field | Description | Default |
129129
|-------|-------------|---------|
130-
| `request_timeout` | Per-request timeout (connect + body). | `120s` |
130+
| `request_timeout` | Per-request timeout (connect + body) for SQL requests. Volume file transfers are limited by storage_read_timeout instead. | `120s` |
131+
| `storage_read_timeout` | Idle limit for Volume file transfers: a transfer fails after this long without progress. | `None` (no limit) |
131132
| `overall_timeout` | Maximum total time across retries for one logical RPC. | `900s` |
132133
| `pool_max_idle_per_host` | Connection-pool size (max idle warm sockets per host). Raise for bursty concurrent workloads. | `100` |
133134
| `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` |

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ moka = { version = "0.12.16", features = ["future"] }
105105

106106
# Async utilities
107107
futures = "0.3"
108-
tokio-util = "0.7"
108+
tokio-util = { version = "0.7", features = ["io"] }
109109
async-trait = "0.1"
110110

111+
# Temporary file that holds a Volume GET download before it is copied into place
112+
tempfile = "3"
113+
111114
# Error handling
112115
thiserror = "2"
113116

@@ -162,7 +165,6 @@ pkcs8 = { version = "0.10", features = ["encryption", "pem", "std"] }
162165
[dev-dependencies]
163166
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util"] }
164167
wiremock = "0.6"
165-
tempfile = "3"
166168
log = "0.4"
167169
# Generate JWT test keys in-process to avoid PEM fixtures and an external
168170
# `openssl` dependency. `ring` already backs runtime JWT signing.

‎NEXT_CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ changes go in their respective binding's NEXT_CHANGELOG.
1111

1212
### Added
1313

14+
- Volume `PUT`, `GET` and `REMOVE`: `ResultStream::complete_volume_operation`
15+
runs the file transfer. Local paths, and the files they resolve to through
16+
symlinks, must be inside the caller's allowed directories. A `PUT` can also
17+
upload bytes the caller supplies.
18+
1419
### Changed
1520

21+
- Adds public fields to `Error` and `ResultManifest`. Code that builds these
22+
structs with struct literals must be updated. Supported consumers are the PyO3,
23+
NAPI, C ABI and ADBC bindings.
24+
1625
### Updated
1726

1827
### Fixed

‎NOTICE‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ Project URL: https://github.com/serde-rs/json
142142
Copyright: Copyright serde_json Authors.
143143

144144

145+
Package: tempfile
146+
Project URL: https://github.com/Stebalien/tempfile
147+
Copyright: Copyright (c) 2015 Steven Allen
148+
149+
145150
Package: thiserror
146151
Project URL: https://github.com/dtolnay/thiserror
147152
Copyright: Copyright thiserror Authors.

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ and security vulnerabilities should be reported according to
6666
[SECURITY.md](SECURITY.md). For other project questions, contact
6767
[eng-oss-sql-driver@databricks.com](mailto:eng-oss-sql-driver@databricks.com).
6868

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

7179
Apache 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).

‎adbc/Cargo.lock‎

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎adbc/NOTICE‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ Project URL: https://github.com/serde-rs/json
142142
Copyright: Copyright serde_json Authors.
143143

144144

145+
Package: tempfile
146+
Project URL: https://github.com/Stebalien/tempfile
147+
Copyright: Copyright (c) 2015 Steven Allen
148+
149+
145150
Package: thiserror
146151
Project URL: https://github.com/dtolnay/thiserror
147152
Copyright: Copyright thiserror Authors.

‎napi/Cargo.lock‎

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)