From 0bbbbc8bafaf0ad8437527fd7ca66f5a4e7d3a63 Mon Sep 17 00:00:00 2001 From: Vu Anh Phung Date: Mon, 23 Nov 2026 18:31:03 +0000 Subject: [PATCH 1/3] prepare release 3.1.0 Signed-off-by: Vu Anh Phung --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb758fbb..90f4829e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## Unreleased +## 3.1.0 - Upgrade the native kernel backend to 1.5.0. diff --git a/package-lock.json b/package-lock.json index 1177e6a3..60dbb637 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@databricks/sql", - "version": "3.0.0", + "version": "3.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@databricks/sql", - "version": "3.0.0", + "version": "3.1.0", "license": "Apache-2.0", "dependencies": { "apache-arrow": "^13.0.0", diff --git a/package.json b/package.json index f60f2c16..99bc0110 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@databricks/sql", - "version": "3.0.0", + "version": "3.1.0", "description": "Driver for connection to Databricks SQL via Thrift API.", "main": "dist/index.js", "types": "dist/index.d.ts", From 8d0fb5af07b9337eb5af3ae6b753d93c628adf1b Mon Sep 17 00:00:00 2001 From: Vu Anh Phung Date: Mon, 23 Nov 2026 19:41:29 +0000 Subject: [PATCH 2/3] docs: condense 3.1.0 release notes Signed-off-by: Vu Anh Phung --- CHANGELOG.md | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f4829e..e44e48a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,36 +2,24 @@ ## 3.1.0 -- Upgrade the native kernel backend to 1.5.0. - -- Avoid intermediate decimal strings when materializing Arrow DECIMAL values with safe unscaled integers, on both backends. -- Reduce Arrow row materialization overhead on both backends by reading vectors directly and resolving scalar conversions once per batch. Object and array row values are unchanged. -- The Thrift token federation exchange (`enableTokenFederation`) now goes through the connection's agent, so `proxy`, `checkServerCertificate`, `customCaCert` and `clientCert`/`clientKey` apply to it. Previously it connected directly with Node's default agent, so behind a required proxy the exchange failed and the driver fell back to the original token. (#611) -- Kernel backend: a failed status poll while waiting for a statement (a `runAsync: true` statement, or a default execution that outlives the server's inline wait) and a failed result fetch in `hasMoreRows()` now throw the mapped driver error, such as `HiveDriverError: HTTP 500: Internal Server Error` once retries on HTTP 5xx run out, instead of a raw `Error` whose message is the internal `__databricks_error__:{...}` envelope. As in `fetchChunk()`, a failed fetch in `hasMoreRows()` also closes the statement. (#608) -- Honor `cloudFetchConcurrentDownloads` when opening kernel sessions, with a default window of 16 and explicit chunk-setting overrides. Values other than positive safe integers raise `HiveDriverError` at session open. -- Reduce result chunking and `fetchAll()` overhead for large query results. -- Thrift CloudFetch downloads are now bounded end to end by `retriesTimeout` (default 15 minutes), including every attempt and retry backoff. Previously a stalled download, where the response headers or body never arrived, blocked the fetch forever. A download still running when the deadline expires is aborted and fails with `RetryError` (`TIMEOUT_EXCEEDED`, message `CloudFetch result download failed: Retry timeout exceeded`). (#520) -- Thrift connections made through `proxy` now apply `checkServerCertificate`, `customCaCert` and `clientCert`/`clientKey`. Previously the proxied path ignored them and verified against Node's process-wide trust store, so a certificate outside the configured trust set could be accepted. **Compatibility:** proxied connections now verify unless `checkServerCertificate: false` is set; as on direct connections, `NODE_TLS_REJECT_UNAUTHORIZED=0` no longer turns verification off. For an `https` proxy these options also apply to the proxy's own certificate. (#485) -- Honor the client `useCloudFetch: false` default on the kernel backend so complete results can be fetched without cloud-storage downloads. (#574) -- Thrift HTTP errors (`THTTPException`) now append server detail from the error headers (at most 500 characters). Kernel-backend errors now carry a non-enumerable `cause` summarizing the kernel error code and message (also at most 500 characters). Reyden fallback preserves KP001 after any existing kernel cause. (#467) -- Add `Symbol.asyncDispose` to clients, sessions, and operations, delegating to `close()`. Use `asyncDisposable()` with interface-typed results in TypeScript; existing interfaces and factory return types remain unchanged. (#331) -- Thrift `ExecuteStatement` requests are now retried when the connection fails before the request is sent (`ECONNREFUSED`, `ENOTFOUND`, `EAI_AGAIN`), within the existing `retryMaxAttempts` / `retriesTimeout` budget; once retries run out, the original connection error is thrown. Failures after the request may have reached the server are still not retried, so a statement can't run twice. (#458) -- Add the `https` connection option: set `https: false` to connect to `host` over plain HTTP (port 80 by default), for example through a trusted local reverse proxy. HTTPS remains the default, and plain HTTP should only be used on a trusted local or private link. (#503) -- Add the `rowMode` option to `executeStatement()`: `rowMode: 'array'` returns each row as an array of values in column order, so columns with the same name (e.g. `SELECT carat AS a, color AS a`) are no longer lost; the default `'object'` rows are unchanged, and the driver now logs a warning when a result has duplicate column names in object mode. (#118) -- CloudFetch retry-exhaustion errors now identify the download and the last failure: the `RetryError` message reads `CloudFetch result download failed: (last error: )`. `` is `HTTP : ` (or `HTTP ` when the status text is empty) for HTTP failures, and `network error `, `network error ()` (e.g. `aborted`, when there is no `code`) or a bare `network error` for network failures (the raw network-error message, which can contain the presigned URL, is not copied). If no cause can be determined, the ` (last error: …)` suffix is omitted. The `RetryError` instance, `errorCode` and `payload` (including the node-fetch `Request` / `Response`) are unchanged. (#471) -- Report untyped NULL columns as STRING in kernel result metadata, matching Thrift. (#470) -- `IOperation.close()` no longer throws when the close request fails after the operation has finished (for example, once its results were read, or when the execute response already reported completion): the failure is logged as a warning and reported in the returned status's `info`, and the operation is still closed locally. Closing an operation that hasn't finished still throws on failure. (#480) -- Reject non-scalar query parameter values at bind time with a `ParameterError` on both the Thrift and kernel backends, instead of stringifying them (which could leave a Thrift operation stuck before FINISHED). Newly rejected on the Thrift backend: arrays, plain objects, boxed primitives (e.g. `new String('x')`, `new Number(1)`), functions, symbols, and a `DBSQLParameter` that wraps another `DBSQLParameter`. Primitives, `Date`, `Int64`, and `DBSQLParameter` are still accepted. -- `DBSQLLogger`: a `filepath` naming an existing directory now writes to `databricks-sql-nodejs.log` inside it, instead of silently producing no logs. (#565) -- `DBSQLLogger`: if the log file can't be opened (including when its directory can't be created, which used to throw from the constructor), the logger now logs to the console only, leaves `transports.file` undefined, and emits a process warning with code `DBSQL_LOG_FILE_UNAVAILABLE`. Previously an unwritable file could silently stall all logging, including the console. (#565) -- Kernel backend: `getPrimaryKeys()` without a `tableName` now throws a `ParameterError` (`Invalid argument: tableName may not be null`, SQLSTATE `42000`) instead of an opaque native conversion error. (#479) -- Upgrade `thrift` to 0.25, which depends on the CommonJS-compatible `uuid@11` instead of the ESM-only `uuid@13`, so `require('@databricks/sql')` works again in Jest and other environments without `require(esm)`. (#461) - - **Behavior change for direct users of the exported `thrift.TCLIService`** (`DBSQLClient` itself uses the callback form and is unaffected): `TCLIService.Client` calls made without a callback now return native Promises instead of Q promises, and `TCLIService.Processor` runs promise-returning handlers through native Promises. Q-only methods such as `.fail()`, `.fin()`, `.done()` and `.spread()` no longer exist; use `.catch()`, `.finally()` and `.then()`. An unhandled rejection is now a real Node unhandled rejection, which crashes the process under Node's default `--unhandled-rejections=throw`. Q only emitted the `unhandledRejection` event manually, so it never crashed. Handle every promise a callback-less client call returns. -- `oauthScopes` is now honored on the Thrift backend: OAuth client-secret M2M sends the configured scopes instead of always `all-apis`, so scoped service-principal secrets can authenticate, and U2M uses them in place of `sql offline_access`. On both backends, entries are split on whitespace and blank values fall back to those defaults. A token read from `persistence` that records different scopes from the ones the client would request is no longer reused or refreshed; the client acquires a new one (for U2M, through a new browser login). Tokens that don't record scopes are still reused. (#540) -- Fix `DECIMAL` parameters losing their fractional digits on the Thrift backend: `"123.45"` was bound as `decimal(3,0)` and came back as `123`. Both backends now send `DECIMAL(p,s)` derived from the value (also for the `DEC` / `NUMERIC` synonyms), stringify `Int64` values beyond 2^53 exactly instead of as `Infinity`, accept exponent forms such as `1e-7` (rewritten as a plain numeral), and throw a `ParameterError` for non-numeric values or values that need more than 38 digits. (#474) -- `customHeaders` are now sent on every Thrift request (session, statement and metadata calls), as the kernel backend already did, instead of only on telemetry and feature-flag requests. On these requests, caller values for driver-managed headers (`Authorization`, `User-Agent`, `Content-Type`, `Content-Length`, `Transfer-Encoding`, `Connection`) are ignored on both backends, and the Thrift backend rejects header names or values that cannot be sent at connect time. (#491) -- Error telemetry now reports only the error class name and the server SQLSTATE. It no longer includes the error message or stack trace, which could contain table and column names from the query. On the Thrift backend, `statement.complete` telemetry now also reports the result delivery format (inline Arrow, inline columnar, or CloudFetch) and whether the server LZ4-compressed the result. (#508) -- Avoid an extra full-buffer copy when downloading Thrift CloudFetch results. +- Upgrade to [kernel 1.5.0](https://github.com/databricks/databricks-sql-kernel/releases/tag/v1.5.0): fix CloudFetch pagination, ordering and cancellation, paged inline Arrow results with CloudFetch disabled, and affected-row counts. +- Kernel: release statement/connection resources promptly on close, avoid duplicate OAuth requests after failure and redundant status/telemetry work, fail fast on TLS certificate errors, and redact CloudFetch URL query strings from errors/logs. Includes Arrow and Quinn dependency security updates. +- Add `rowMode: 'array'` to retain columns with duplicate names; object mode now warns about duplicates. +- Add `Symbol.asyncDispose` and the `asyncDisposable()` helper for clients, sessions and operations. +- Add `https: false` for plain HTTP connections over trusted local/private links. +- Speed up Arrow row conversion and large-result fetching by reducing copying, intermediate decimal strings and batch-processing overhead. +- Honor `oauthScopes`, stop reusing persisted tokens with different recorded scopes, and apply proxy/TLS options to token federation. +- **Proxy TLS compatibility:** honor custom CAs, mTLS and certificate verification on Thrift proxy connections, including HTTPS proxies. Disable verification explicitly with `checkServerCertificate: false`; `NODE_TLS_REJECT_UNAUTHORIZED=0` no longer disables it. +- Send `customHeaders` on all Thrift requests; reject invalid headers and prevent overrides of driver-managed headers. +- Bound Thrift CloudFetch downloads and retry backoff by `retriesTimeout` (default 15 minutes). Abort timed-out downloads with `RetryError` / `TIMEOUT_EXCEEDED`; retry errors now include the last HTTP/network failure. +- Honor `useCloudFetch: false` and `cloudFetchConcurrentDownloads` in kernel sessions. Concurrency defaults to 16, requires a positive safe integer, and can be overridden by explicit chunk settings. +- Retry Thrift `ExecuteStatement` connection failures only when the request has not been sent, within the existing retry budget. +- Preserve typed kernel polling/fetch errors and expose server details/kernel causes. Closing finished operations is now best effort; closing unfinished operations still reports failures. +- Preserve `DECIMAL` parameter precision/scale, including exponent forms and large `Int64` values; reject invalid or non-scalar parameters with `ParameterError`. +- Kernel: report untyped NULL columns as STRING and reject `getPrimaryKeys()` calls without a `tableName` with `ParameterError`. +- Write `databricks-sql-nodejs.log` when `DBSQLLogger`'s `filepath` is a directory; fall back to console with `DBSQL_LOG_FILE_UNAVAILABLE` if file logging fails. +- Limit error telemetry to error class and SQLSTATE; add result-delivery and compression metadata to statement telemetry. +- **Thrift compatibility:** upgrade to 0.25 to restore CommonJS/Jest loading. Callback-less `thrift.TCLIService` client calls and promise-returning processor handlers now use native Promises. Replace Q-only methods such as `.fail()` / `.fin()` with `.catch()` / `.finally()`, and handle rejections, which now follow Node's default crash behavior. The Promise migration leaves `DBSQLClient` unchanged. ## 3.0.0 From 1fe257b469f7ab3d7b2878480690b142345a8033 Mon Sep 17 00:00:00 2001 From: Vu Anh Phung Date: Mon, 23 Nov 2026 19:51:22 +0000 Subject: [PATCH 3/3] docs: clarify OAuth scope migration notes Signed-off-by: Vu Anh Phung --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e44e48a8..2fbcb477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - Add `Symbol.asyncDispose` and the `asyncDisposable()` helper for clients, sessions and operations. - Add `https: false` for plain HTTP connections over trusted local/private links. - Speed up Arrow row conversion and large-result fetching by reducing copying, intermediate decimal strings and batch-processing overhead. -- Honor `oauthScopes`, stop reusing persisted tokens with different recorded scopes, and apply proxy/TLS options to token federation. +- Thrift OAuth now honors `oauthScopes` for M2M (instead of `all-apis`) and U2M (instead of `sql offline_access`). Persisted tokens with different recorded scopes are replaced; U2M requires a new browser login. Token federation now honors proxy/TLS options. - **Proxy TLS compatibility:** honor custom CAs, mTLS and certificate verification on Thrift proxy connections, including HTTPS proxies. Disable verification explicitly with `checkServerCertificate: false`; `NODE_TLS_REJECT_UNAUTHORIZED=0` no longer disables it. - Send `customHeaders` on all Thrift requests; reject invalid headers and prevent overrides of driver-managed headers. - Bound Thrift CloudFetch downloads and retry backoff by `retriesTimeout` (default 15 minutes). Abort timed-out downloads with `RetryError` / `TIMEOUT_EXCEEDED`; retry errors now include the last HTTP/network failure.