Skip to content

Commit 73b9a3a

Browse files
authored
Prepare for v2.0.0 release (#593)
Prepare v2.0.0 with the `/v2` Go module path required by the Arrow v18 public API change. Update driver imports and examples, bump `DriverVersion`, and publish the reviewed changelog and migration instructions. Validation: short tests passed with both the default build and `CGO_ENABLED=1 -tags databricks_kernel`. All five required correctness suites passed on DBR 17.3.25 and 18.3.11 (Linux AMD64, Thrift with inline results; CloudFetch is disabled in the LITE harness). CI is pending. This pull request was AI-assisted by Isaac. --- <!-- GITHUB_MCP_FOOTER: This attribution is automatically appended by GitHub MCP. --> _This PR was created with [GitHub MCP](http://go/mcps)._
2 parents c94b0de + 76cfa71 commit 73b9a3a

164 files changed

Lines changed: 557 additions & 530 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.golangci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ linters:
2323
main:
2424
allow:
2525
- $gostd
26-
- github.com/databricks/databricks-sql-go
26+
- github.com/databricks/databricks-sql-go/v2
2727
- github.com/databricks/databricks-sql-kernel-bindings
2828
- github.com/apache/arrow-go/v18
2929
- github.com/apache/thrift/lib/go/thrift

‎CHANGELOG.md‎

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11
# Release History
22

3-
## Unreleased (v2.0.0 prototype)
4-
5-
- Upgrade the SQL kernel bindings to v1.5.0.
6-
- Fix leaked HTTP connections after failed or retry-exhausted requests, which could exhaust a connector's connection pool. Remove the MPL-2.0 go-retryablehttp and go-cleanhttp dependencies while preserving first-send bodies, streaming trailers and retry behavior (databricks/databricks-sql-go#177).
7-
- Fix OAuth M2M token requests hanging indefinitely when the token endpoint stops responding. Each request now uses a copy of `http.DefaultClient` with a timeout of at most 60s; `WithRetries` repeats failed fetches (databricks/databricks-sql-go#475).
8-
- **Behavior change:** Top-level GEOMETRY and GEOGRAPHY columns report server SQL names including SRIDs on Thrift and SEA. With `WithEnableGeoSpatialSupport(true)` (`enableGeoSpatialSupport=true`, available since v1.17.0), previously bare `GEOMETRY` / `GEOGRAPHY` names now include the declared SRID, such as `GEOMETRY(0)`, `GEOGRAPHY(4326)` or `GEOMETRY(ANY)`; match the family before `(` when selecting a decoder. String mode previously reported `STRING`; values, scan types, lengths and raw Arrow schemas are unchanged, and Thrift retains `STRING` without a readable Arrow schema (databricks/databricks-sql-go#474).
9-
- Render non-finite FLOAT / DOUBLE values inside ARRAY / MAP / STRUCT results as the JSON strings `"NaN"`, `"Infinity"`, and `"-Infinity"` on both backends instead of failing row iteration. SQL NULL remains `null`; top-level floats remain numeric (databricks/databricks-sql-go#573).
10-
- **Behavior change:** Non-finite floating-point MAP keys use the same spellings as values on both backends. On the kernel backend, keys previously rendered as `"+Inf"` and `"-Inf"` now render as `"Infinity"` and `"-Infinity"`; `"NaN"` is unchanged. On Thrift, these keys previously failed row iteration (databricks/databricks-sql-go#573).
11-
- Fix the module-root package conflict when building, linting, or running Gazelle with the `tools` build tag (databricks/databricks-sql-go#162).
12-
- **Behavior change:** Report declared DECIMAL precision and scale through `sql.ColumnType.DecimalSize()` on Thrift and SEA, including zero-row results. Tools such as ORM migrators can now act on these qualifiers (databricks/databricks-sql-go#500).
13-
- **Behavior change:** Support Arrow TIME results on Thrift and SEA as UTC `time.Time` values on `0001-01-01`, preserving precision and using clock-only nested JSON. TIME metadata now reports `TIME`/`time.Time` with no length, including empty and NULL-only results; previously Thrift reported `STRING`/`string` with unbounded length, and SEA reported an empty name with `*interface{}` (databricks/databricks-sql-go#505).
14-
- **Behavior change:** Explicit `WithMaxDownloadThreads` / `maxDownloadThreads` settings tuned for Thrift also control kernel buffering and can change memory use and throughput. The kernel window defaults to 16 when unset; explicit chunk-setting overrides take precedence.
15-
- **Breaking change:** Upgrade Apache Arrow Go from v12 to v18.8.0 (`github.com/apache/arrow-go/v18`). The public `rows.ArrowBatchIterator` now uses v18 `arrow.RecordBatch` and `*arrow.Schema` types; callers using Arrow batches must migrate their Arrow imports and dependent code. This requires a major driver release (v2.0.0), including a `/v2` driver module path before publication.
16-
- Fix CloudFetch reads failing with `row number 0 is not contained in any arrow batch: EOF` when `WithMaxDownloadThreads` / `maxDownloadThreads` is 0 or negative. Such values now log a warning and use the default of 10 (databricks/databricks-sql-go#439).
17-
- **Behavior change:** On the Thrift backend, `ExecuteStatement` is now retried (per `WithRetries`) when the connection to the server or proxy can't be opened, for example connection refused or a connect timeout, because the statement was never sent. Failures after the connection exists are still not retried, so a statement never runs twice. With default retry settings, a refused connection now fails after about 15 seconds instead of immediately (databricks/databricks-sql-go#423).
18-
- Honor `WithCloudFetch(false)` / `useCloudFetch=false` on the kernel backend to fetch complete results without cloud-storage downloads. The option overrides conflicting session configuration and remains effective after automatic backend recovery. Servers without paged inline support return a configuration error; the driver does not fall back to storage downloads.
19-
- **Behavior change:** After `Close`, a raw `driver.Conn` now fails `Prepare`, `PrepareContext`, `ExecContext` and `QueryContext` immediately with a `driver.ErrBadConn` ("connection is closed") and sends no request. Previously `Prepare` returned a statement and the failure came from the server or kernel at execute. `database/sql` users are unaffected (databricks/databricks-sql-go#521).
20-
- Report `statement_type` (`SQL`, as on the kernel backend) and the result delivery format (`INLINE_ARROW`, `EXTERNAL_LINKS` or `COLUMNAR_INLINE`) in Thrift statement telemetry. The format is reported when the driver already has the result metadata (databricks/databricks-sql-go#454).
21-
- **Behavior change:** The DSN `timeout` param now rejects values outside ±9223372036 seconds with an error naming `timeout`. These values previously overflowed `time.Duration` and silently became a different, often negative, timeout. Negative values within range are still accepted (databricks/databricks-sql-go#490).
3+
## v2.0.0 (2026-11-23)
4+
5+
### Breaking changes
6+
7+
- The module path is now `github.com/databricks/databricks-sql-go/v2`. Add `/v2` to driver and subpackage imports.
8+
- Upgrade Apache Arrow Go from v12 to v18.8.0 (`github.com/apache/arrow-go/v18`). The public `rows.ArrowBatchIterator` now uses v18 `arrow.RecordBatch` and `*arrow.Schema`; update Arrow imports and code that uses batches.
9+
10+
### Driver changes
11+
12+
- Fix HTTP connection leaks after failed requests or exhausted retries. Remove the MPL-2.0 `go-retryablehttp` and `go-cleanhttp` dependencies (databricks/databricks-sql-go#177).
13+
- Cap OAuth M2M token requests at 60 seconds and retry failures according to `WithRetries`, preventing indefinite hangs (databricks/databricks-sql-go#475).
14+
- Top-level GEOMETRY and GEOGRAPHY type names now include SRIDs, such as `GEOMETRY(0)`, `GEOGRAPHY(4326)` or `GEOMETRY(ANY)`, in both string mode and `WithEnableGeoSpatialSupport(true)` mode. Match the family before `(` when choosing a decoder. Values and scan types are unchanged; Thrift still reports `STRING` without a readable Arrow schema (databricks/databricks-sql-go#474).
15+
- Render non-finite FLOAT / DOUBLE values and MAP keys inside ARRAY / MAP / STRUCT results as JSON strings `"NaN"`, `"Infinity"` and `"-Infinity"` on both backends. This fixes Thrift row-iteration errors and changes kernel MAP keys from `"+Inf"` / `"-Inf"`. SQL NULL remains `null`; top-level floats remain numeric (databricks/databricks-sql-go#573).
16+
- Report declared DECIMAL precision and scale through `sql.ColumnType.DecimalSize()` on both backends, including empty results (databricks/databricks-sql-go#500).
17+
- Return Arrow TIME values as UTC `time.Time` on `0001-01-01`, preserving precision and using clock-only nested JSON. Both backends now report `TIME`/`time.Time` with no length, including empty and NULL-only results, replacing Thrift's `STRING`/`string` and SEA's empty type name/`*interface{}` (databricks/databricks-sql-go#505).
18+
- Top-level VARIANT columns now report `VARIANT` instead of `STRING` from `sql.ColumnType.DatabaseTypeName()`. Values remain JSON text with scan type `string` and unchanged length. Thrift still reports `STRING` without a server-supplied Arrow schema (databricks/databricks-sql-go#576).
19+
- Explicit `WithMaxDownloadThreads` / `maxDownloadThreads` settings now also control kernel buffering, affecting memory use and throughput. Unset defaults remain 10 for Thrift and 16 for the kernel; explicit kernel chunk settings take precedence. Zero or negative values warn and use 10, fixing CloudFetch EOF errors (databricks/databricks-sql-go#439).
20+
- Retry Thrift `ExecuteStatement` according to `WithRetries` only when a connection to the server or proxy cannot be opened, before the statement is sent. Failures after connecting are still not retried. With default settings, a refused connection now fails after about 15 seconds (databricks/databricks-sql-go#423).
21+
- After `Close`, raw `driver.Conn` calls to `Prepare`, `PrepareContext`, `ExecContext` and `QueryContext` now immediately return `driver.ErrBadConn` ("connection is closed"). `database/sql` users are unaffected (databricks/databricks-sql-go#521).
22+
- Reject DSN `timeout` values outside ±9223372036 seconds instead of silently overflowing `time.Duration`. Negative values within range remain valid (databricks/databricks-sql-go#490).
2223
- Avoid redundant Thrift result fetches when direct results specify `hasMoreRows=false` (databricks/databricks-sql-go#539).
23-
- **Behavior change:** Top-level VARIANT columns report `VARIANT` from `sql.ColumnType.DatabaseTypeName()` on Thrift and SEA instead of `STRING`, matching the Python and JDBC drivers. Values stay JSON text, and the scan type (`string`) and length are unchanged. Nested VARIANT is not reported by name. On Thrift, this requires the server-supplied Arrow result schema; without it, VARIANT still reports `STRING` (databricks/databricks-sql-go#576).
24+
- Add `statement_type=SQL` and the result delivery format (`INLINE_ARROW`, `EXTERNAL_LINKS` or `COLUMNAR_INLINE`, when known) to Thrift statement telemetry (databricks/databricks-sql-go#454).
25+
- Fix the module-root package conflict when building, linting or running Gazelle with the `tools` build tag (databricks/databricks-sql-go#162).
26+
27+
### SQL kernel v1.5.0
28+
29+
Upgrade the kernel bindings to [v1.5.0](https://github.com/databricks/databricks-sql-kernel/blob/v1.5.0/CHANGELOG.md) with these changes for the kernel backend:
30+
31+
- Fix CloudFetch prefetching across result pages, share in-flight page requests, honor cancellation and return cached final chunks before EOF.
32+
- Fetch all inline result pages with `WithCloudFetch(false)` / `useCloudFetch=false`. This option overrides conflicting session settings and survives automatic backend recovery. Servers without paged inline support return a configuration error instead of downloading from cloud storage.
33+
- Release transport, HTTP client and runtime resources on session close, including resources retained by OAuth providers.
34+
- Authenticate once before resolving feature flags; fail session open immediately if OAuth token retrieval fails.
35+
- Fail TLS certificate verification errors after one attempt and report the underlying cause, including CloudFetch downloads.
36+
- Omit signed URL query strings and signatures from CloudFetch errors and debug logs.
37+
- Avoid redundant telemetry flush tasks during event bursts.
38+
- Update Rust Arrow to 59.3.2 and QUIC dependencies for security fixes.
2439

2540
## v1.19.0 (2026-11-04)
2641
- Upgrade the SQL kernel bindings to v1.4.0.

‎README.md‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ standard `database/sql` interface.
99
## Contents
1010

1111
- [Quick start](#quick-start)
12+
- [Migrating from v1](#migrating-from-v1)
1213
- [Cloning the repository](#cloning-the-repository)
1314
- [Choosing a backend (Thrift vs SEA/kernel)](#choosing-a-backend-thrift-vs-seakernel)
1415
- [Building](#building)
@@ -31,7 +32,7 @@ standard `database/sql` interface.
3132
import (
3233
"context"
3334
"database/sql"
34-
_ "github.com/databricks/databricks-sql-go"
35+
_ "github.com/databricks/databricks-sql-go/v2"
3536
)
3637

3738
db, err := sql.Open("databricks", "token:********@********.databricks.com:443/sql/1.0/endpoints/********")
@@ -48,10 +49,21 @@ See [`doc.go`](./doc.go) for full package documentation or the Databricks docume
4849
for the [SQL Driver for Go](https://docs.databricks.com/dev-tools/go-sql-driver.html).
4950

5051
> **Using the driver in your own project?** Add it with `go get
51-
> github.com/databricks/databricks-sql-go` and `go build` — you never clone this repo.
52+
> github.com/databricks/databricks-sql-go/v2` and `go build` — you never clone this repo.
5253
> A default Thrift build pulls **no** kernel binaries. The "Cloning" section below is
5354
> only for contributors working in this repo directly.
5455
56+
## Migrating from v1
57+
58+
Install v2 with `go get github.com/databricks/databricks-sql-go/v2@v2.0.0` and
59+
add `/v2` to all driver import paths, including subpackages such as `auth` and
60+
`rows`.
61+
62+
If you use the Arrow batch API, migrate Arrow imports from
63+
`github.com/apache/arrow/go/v12` to `github.com/apache/arrow-go/v18`.
64+
`rows.ArrowBatchIterator` now returns v18 `arrow.RecordBatch` values and
65+
`*arrow.Schema` metadata.
66+
5567
## Cloning the repository
5668

5769
This repo is **small**: for the SEA/kernel backend it commits only the C header
@@ -193,7 +205,7 @@ You can also connect with a connector object built from functional options:
193205
```go
194206
import (
195207
"database/sql"
196-
dbsql "github.com/databricks/databricks-sql-go"
208+
dbsql "github.com/databricks/databricks-sql-go/v2"
197209
)
198210

199211
connector, err := dbsql.NewConnector(

‎auth/oauth/m2m/m2m.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sync"
88
"time"
99

10-
"github.com/databricks/databricks-sql-go/auth"
11-
"github.com/databricks/databricks-sql-go/auth/oauth"
12-
"github.com/databricks/databricks-sql-go/logger"
10+
"github.com/databricks/databricks-sql-go/v2/auth"
11+
"github.com/databricks/databricks-sql-go/v2/auth/oauth"
12+
"github.com/databricks/databricks-sql-go/v2/logger"
1313
"golang.org/x/oauth2"
1414
"golang.org/x/oauth2/clientcredentials"
1515
)

‎auth/oauth/m2m/m2m_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"testing"
1111
"time"
1212

13-
"github.com/databricks/databricks-sql-go/auth"
13+
"github.com/databricks/databricks-sql-go/v2/auth"
1414
"github.com/stretchr/testify/assert"
1515
"github.com/stretchr/testify/require"
1616
"golang.org/x/oauth2"

‎auth/oauth/oauth.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"time"
1212

1313
"github.com/coreos/go-oidc/v3/oidc"
14-
"github.com/databricks/databricks-sql-go/logger"
14+
"github.com/databricks/databricks-sql-go/v2/logger"
1515
"golang.org/x/oauth2"
1616
)
1717

‎auth/oauth/u2m/authenticator.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818

1919
"github.com/pkg/browser"
2020

21-
"github.com/databricks/databricks-sql-go/auth"
22-
"github.com/databricks/databricks-sql-go/auth/oauth"
23-
"github.com/databricks/databricks-sql-go/logger"
21+
"github.com/databricks/databricks-sql-go/v2/auth"
22+
"github.com/databricks/databricks-sql-go/v2/auth/oauth"
23+
"github.com/databricks/databricks-sql-go/v2/logger"
2424
"golang.org/x/oauth2"
2525
)
2626

‎auth/oauth/u2m/u2m.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66
"strings"
77

8-
"github.com/databricks/databricks-sql-go/auth/oauth"
9-
"github.com/databricks/databricks-sql-go/auth/oauth/pkce"
8+
"github.com/databricks/databricks-sql-go/v2/auth/oauth"
9+
"github.com/databricks/databricks-sql-go/v2/auth/oauth/pkce"
1010
"golang.org/x/oauth2"
1111
)
1212

‎auth/tokenprovider/authenticator.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66
"net/http"
77

8-
"github.com/databricks/databricks-sql-go/auth"
9-
"github.com/databricks/databricks-sql-go/logger"
8+
"github.com/databricks/databricks-sql-go/v2/auth"
9+
"github.com/databricks/databricks-sql-go/v2/logger"
1010
)
1111

1212
// TokenProviderAuthenticator implements auth.Authenticator using a TokenProvider.

‎auth/tokenprovider/cached.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"sync"
77
"time"
88

9-
"github.com/databricks/databricks-sql-go/logger"
9+
"github.com/databricks/databricks-sql-go/v2/logger"
1010
)
1111

1212
// CachedTokenProvider wraps another provider and caches tokens

0 commit comments

Comments
 (0)