Skip to content

Commit da7d420

Browse files
authored
[Kernel OSS Readiness] Simplify Rust ADBC README (#503)
## Description Simplify the experimental Rust ADBC README to match the high-level style used by the OSS JDBC driver. It keeps the experimental status, build commands, a minimal connection example, supported authentication categories, capabilities, and key limitations while removing exhaustive option and implementation details. ## Testing - `git diff --check` - Reviewed the retained commands and version claims against `adbc/Cargo.toml` ## Additional notes Documentation-only change; no driver behavior or configuration support changes. --- <!-- GITHUB_MCP_FOOTER: This attribution is automatically appended by GitHub MCP. --> _This PR was created with [GitHub MCP](http://go/mcps)._ Signed-off-by: Rahul Singhal <rahul.singhal@databricks.com>
1 parent 8d88cce commit da7d420

1 file changed

Lines changed: 36 additions & 159 deletions

File tree

‎adbc/README.md‎

Lines changed: 36 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,31 @@
44
> This implementation is experimental, unsupported, and not currently published
55
> or distributed. Its API and behavior may change without notice.
66
7-
This crate implements ADBC 1.1 for Databricks. It calls the Databricks SQL
8-
Kernel through its native Rust API and returns Arrow 59 record batches without
9-
an IPC or C-ABI conversion between the driver and kernel.
7+
This crate implements ADBC 1.1 for Databricks on top of the Databricks SQL
8+
Kernel. It provides the Rust `adbc_core` traits and an optional ADBC C driver
9+
for driver managers and other languages.
1010

11-
The crate provides two consumer surfaces:
11+
## Build
1212

13-
- the Rust `adbc_core` 0.24 traits; and
14-
- an optional ADBC C driver for driver managers and other languages.
13+
Build the native Rust driver:
1514

16-
The C surface does not change the internal integration: it is an export layer
17-
over the same Rust implementation.
15+
```text
16+
cargo build --manifest-path adbc/Cargo.toml --release
17+
```
1818

19-
## Build
19+
Enable the optional ADBC C interface with the `ffi` feature:
2020

2121
```text
22-
cargo build --manifest-path adbc/Cargo.toml --release
2322
cargo build --manifest-path adbc/Cargo.toml --release --features ffi
2423
```
2524

26-
The `ffi` build exports both `AdbcDatabricksInit` and the conventional
27-
`AdbcDriverInit` alias. The release library is produced as an `rlib`, `cdylib`,
28-
and `staticlib`; see `PACKAGING.md` for release gates.
29-
30-
This crate is a standalone Cargo workspace inside the kernel repository. Cargo
31-
builds the kernel directly from `../` for repository development. The
32-
accompanying version constraint becomes the registry dependency when the
33-
crates are published; publish the matching kernel version first.
25+
The ADBC crate is a standalone Cargo workspace in this repository and depends
26+
directly on the kernel's Rust crate.
3427

3528
## Connect from Rust
3629

37-
Create a `Driver`, then create a database with a workspace URI, one
38-
warehouse selector, and authentication options:
39-
40-
Native Rust applications may instead create a database with
41-
`Database::with_runtime(Arc<tokio::runtime::Runtime>)`. The runtime must use
42-
Tokio's multi-thread scheduler, remains owned by the application, and is shared
43-
by every connection created from that database. The standard ADBC `Driver`
44-
surface creates a bounded driver-owned runtime shared at database scope.
30+
Create a driver and configure it with your Databricks workspace, SQL warehouse,
31+
and credentials:
4532

4633
```rust,no_run
4734
use adbc_core::options::{OptionDatabase, OptionValue};
@@ -66,140 +53,30 @@ let database = driver.new_database_with_opts([
6653
# Ok::<(), Box<dyn std::error::Error>>(())
6754
```
6855

69-
Exactly one of `adbc.databricks.http_path` and
70-
`adbc.databricks.warehouse_id` is required. Preserve an organization query
71-
parameter in the HTTP path when the workspace connection details include one.
72-
Canonical `adbc.databricks.*` names take precedence over compatibility aliases.
73-
74-
## Authentication
75-
76-
Set `adbc.databricks.auth.type` to one of `pat`, `oauth_m2m`, `oauth_u2m`,
77-
`oauth_m2m_private_key`, or `azure_service_principal`. When the type is omitted,
78-
the driver infers it only when the supplied credentials are unambiguous.
79-
80-
| Mode | Required options |
81-
| --- | --- |
82-
| PAT | `adbc.databricks.auth.token` |
83-
| OAuth M2M | `adbc.databricks.oauth.client_id`, `adbc.databricks.oauth.client_secret` |
84-
| OAuth U2M | interactive login; optional client ID, scopes, redirect ports, callback timeout, and encrypted token-cache settings |
85-
| Private-key OAuth M2M | client ID, `adbc.databricks.oauth.jwt.key_file`; optional key ID, algorithm, and passphrase |
86-
| Azure service principal | `adbc.databricks.azure.client_id`, client secret, tenant ID, and workspace resource ID |
87-
88-
`adbc.databricks.identity_federation_client_id` can be added to supported base
89-
authentication modes. Client secrets, tokens, passphrases, proxy passwords, and
90-
private keys are write-only and redacted from debug output. Supply them at
91-
runtime; do not place them in source code, manifests, logs, or connection URLs.
92-
Do not include connection options, environment dumps, token-cache contents, or
93-
credential files in bug reports. Rotate a credential immediately if it may
94-
have appeared in output retained by an application or support system.
95-
96-
## Configuration
97-
98-
The main database option families are:
99-
100-
| Family | Options |
101-
| --- | --- |
102-
| Namespace | `adbc.databricks.catalog`, `adbc.databricks.schema` |
103-
| Attribution | `adbc.databricks.user_agent_entry` |
104-
| Session | `adbc.databricks.session_conf.<name>`, `adbc.databricks.ssp_ansi_mode`, `adbc.databricks.ssp_timezone`, `adbc.databricks.query_tags` |
105-
| HTTP | request/overall timeouts, idle pool size, retry limits/backoff, response compression, JSON custom headers |
106-
| Proxy | URL, username, password, bypass hosts |
107-
| TLS/mTLS | CA file or PEM, client certificate/key file or PEM, self-signed and hostname-verification controls |
108-
| Logging | filter and file |
109-
| Telemetry | enablement, batch/flush/retry settings, close timeout, circuit breaker settings |
110-
| Results | complex datatype support, geospatial representation, CloudFetch enablement and buffering |
111-
| Execution | `adbc.databricks.enable_direct_results` (default `true`); set `false` to use `wait_timeout=0s` and status polling |
112-
| Metadata | `adbc.databricks.metadata.escape_catalog_name` |
113-
114-
The optional user-agent entry is appended to the driver-owned identity as
115-
`RustADBCDatabricksDriver/<version> (<entry>)`. Set it through
116-
`adbc.databricks.user_agent_entry`; `User-Agent` is not accepted in the generic
117-
custom-header option. `adbc.spark.user_agent_entry` is accepted as a
118-
compatibility alias; the canonical option wins when both are set.
119-
120-
Proxy credentials must use the dedicated options; URL userinfo is rejected.
121-
Certificate and key options must be supplied as a pair. File-backed credential
122-
and TLS values are read during database initialization.
123-
The self-signed-certificate and hostname-verification bypasses weaken TLS and
124-
must remain disabled outside isolated test environments.
125-
Telemetry numeric options accept either ADBC integer values or their decimal
126-
string forms, as used by connection-string and cross-driver adapters.
127-
128-
`adbc.databricks.metadata.escape_catalog_name` defaults to `true`. It escapes
129-
only unescaped `_` characters in `GetObjects` and metadata-command catalog
130-
patterns, matching the catalog-name behavior of the Python and Node drivers.
131-
It preserves `%` wildcards and existing `\_` escapes and does not alter schema,
132-
table, or column patterns. Set it to `false` for raw ADBC catalog-pattern
133-
semantics.
134-
135-
Statement options include positional or named parameter style, query tags,
136-
the portable `adbc.apache.statement.query_timeout_s` client deadline (with `0`
137-
meaning unlimited), a millisecond Databricks client-timeout alias, server
138-
timeout, row limit, and
139-
`adbc.databricks.statement.rows_fetched_per_block` for client-observed Arrow
140-
batch slicing, and `adbc.databricks.statement.conf.<name>`. `bind` and `bind_stream` accept Arrow
141-
batches; multi-row bindings execute sequentially and expose one logical result
142-
stream. `prepare` is client-side. Parameter schemas may contain nullable Arrow
143-
`Null` fields when the server does not expose exact inferred types.
144-
145-
For compatibility with metadata-statement consumers, set
146-
`adbc.apache.statement.is_metadata_command` to the string `true`, set the SQL
147-
text to `GetCatalogs`, `GetSchemas`, `GetTables`, `GetColumns`,
148-
`GetPrimaryKeys`, or `GetCrossReference`, and supply
149-
filters through `adbc.get_metadata.target_catalog`, `target_db_schema`,
150-
`target_table`, `target_column`, and `target_table_types`. `GetCrossReference`
151-
also accepts the foreign-target catalog, schema, and table keys.
152-
`adbc.get_metadata.escape_pattern_wildcards` defaults to `false`; when set to
153-
`true`, backslash, `_`, and `%` are escaped so the supplied filters are treated
154-
as literal identifiers. These
155-
commands return the flat JDBC metadata schemas used by the other Databricks
156-
drivers; `GetColumns` includes the Databricks `BASE_TYPE_NAME` extension. This
157-
compatibility surface is separate from standard nested ADBC `GetObjects`.
158-
159-
Native Rust callers can use `Statement::submit` to obtain a borrowing
160-
`SubmittedStatement`, poll its status, cancel it, or await/fetch its result.
161-
The handle prevents mutation or resubmission of the statement while the
162-
operation is pending. Client query deadlines and rows-per-block slicing apply
163-
equally to synchronous and submitted execution. Dropping a submitted handle or
164-
an incompletely consumed reader triggers best-effort server cleanup.
165-
166-
Set `adbc.databricks.cloudfetch.enabled` to `false` to fetch results through
167-
the SQL connection when the application cannot access cloud storage directly.
168-
Large results are read in pages.
169-
The warehouse must support paged inline delivery; otherwise session creation
170-
or the first statement returns the server's configuration error.
171-
172-
## ADBC behavior
173-
174-
The driver supports query/update execution, cancellation, result draining,
175-
`GetInfo`, `GetObjects`, table types, table schemas, catalogs/schemas, and
176-
dedicated primary-key/cross-reference metadata commands. As in the C# driver,
177-
`GetObjects` leaves `table_constraints` null; applications request key metadata
178-
through the dedicated commands described above. Errors preserve ADBC status,
179-
SQLSTATE, vendor code, and Databricks details when supplied by the kernel.
180-
181-
Transactions are ignored by the current kernel configuration: autocommit stays
182-
enabled, and disabling it returns `NotImplemented`. Partitioned execution,
183-
reading partitions, statistics, and progress reporting are optional ADBC
184-
surfaces and currently return `NotImplemented`. Native Rust connection
185-
cancellation is supported. The optional C driver intentionally reports
186-
connection and statement cancellation as `NotImplemented` because `adbc_ffi`
187-
0.24 cannot export concurrent cancel calls without violating Rust aliasing
188-
rules. Native Rust cancellation handles remain available internally.
189-
190-
The standard ADBC methods are synchronous. The native Rust submit/poll extension
191-
provides caller-driven non-blocking execution. Both surfaces are safe to call
192-
from outside Tokio or from current-thread and multi-thread Tokio runtimes;
193-
kernel work is bridged without nesting `Runtime::block_on` on the caller
194-
runtime.
56+
## Authentication and configuration
57+
58+
The driver supports personal access tokens, OAuth machine-to-machine and
59+
user-to-machine flows, private-key OAuth, and Azure service principals.
60+
61+
Configuration is available for catalogs and schemas, session settings, HTTP
62+
and proxy behavior, TLS, logging, telemetry, result fetching, query execution,
63+
and metadata. Supply credentials at runtime and do not place them in source
64+
code, manifests, logs, or connection URLs.
65+
66+
## Supported functionality
67+
68+
The driver supports query and update execution, parameter binding,
69+
cancellation, Arrow result streaming, and ADBC metadata operations such as
70+
`GetInfo`, `GetObjects`, and table schema discovery. It also supports an
71+
optional C interface and native Rust asynchronous submission and polling.
72+
73+
Transactions, partitioned execution, statistics, and progress reporting are
74+
not currently implemented.
19575

19676
## Compatibility and status
19777

198-
The current implementation targets Rust 1.89+, Rust edition 2021, ADBC 1.1 (`adbc_core` 0.24),
199-
Arrow 59, and `databricks-sql-kernel` 1.4. Linux x86-64 is the locally validated
200-
platform. Windows and macOS artifacts require their platform release gates
201-
before a production release.
78+
The current implementation targets Rust 1.89+, Rust edition 2021, ADBC 1.1,
79+
and Arrow 59. Linux x86-64 is the currently validated platform.
20280

203-
Repository CI validates the native Rust surface, the optional ADBC C ABI, and
204-
dynamic loading through both exported entry points. Cross-driver qualification
205-
and release evidence remain separate from this public API documentation.
81+
The driver remains experimental. Publishing, platform qualification, and
82+
support commitments require separate release-readiness review.

0 commit comments

Comments
 (0)