Merge release/6.1.0 into master#3
Conversation
Metabase team gave us a patch branch that disables a failing test We need to use this branch until the fix makes it to a new release
Upgrade to Metabase 1.46.4
Implement impersonation
Fix datetime filter issue with Metabase 0.47
Remote deprecated method
Add query remarks
Support JDBC explicitPrepare flag
Switch to Metabase v1.48.3
Upgrade to Metabase 1.50
Upgrade to Metabase 1.52
Prepare release 5.0.0
Prepare release 6.0.0
Overload connection timeout property to avoid long query timeouts
Prepare release 6.1.0
There was a problem hiding this comment.
Pull request overview
Merges the release/6.1.0 Starburst driver line back into master, updating the driver implementation and local/CI tooling to match the intended Metabase/Trino versions and restored behaviors (prepared statements, cancel support, pool timeout override, impersonation).
Changes:
- Bump driver + dependency versions (Metabase/Trino) and update plugin metadata/changelog.
- Refactor Starburst driver internals (HoneySQL 2 migration, execution/sync/connectivity behavior changes, impersonation + “optimized prepared statements” support).
- Update test infrastructure (Trino docker catalog setup, dataset loading behavior, CI + Makefile workflows, additional driver tests).
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
test_test.clj |
Adds custom clj-kondo hook tests used during make test. |
resources/docker/trino/entrypoint.sh |
Simplifies Trino catalog setup to a single test_data memory catalog. |
package.json |
Introduces rspack-related JS dependencies at repo root. |
drivers/starburst/test/metabase/test/data/starburst.clj |
Updates Starburst test extensions, dataset naming, and data-loading strategy. |
drivers/starburst/test/metabase/driver/starburst_test.clj |
Updates Starburst driver tests for new dataset naming and adds impersonation/prepared-statement tests. |
drivers/starburst/src/metabase/driver/starburst.clj |
Expands driver entrypoint behaviors (remarks + connect handling) and loads implementation modules. |
drivers/starburst/src/metabase/driver/implementation/sync.clj |
Refactors sync/describe implementations and privilege probing. |
drivers/starburst/src/metabase/driver/implementation/query_processor.clj |
Migrates Starburst query processor behavior to HoneySQL 2 and updates temporal/datetime-diff logic. |
drivers/starburst/src/metabase/driver/implementation/messages.clj |
Adds Starburst-specific user-facing message constants. |
drivers/starburst/src/metabase/driver/implementation/execute.clj |
Refactors connection handling, adds impersonation hooks, prepared statement proxying, and pool override. |
drivers/starburst/src/metabase/driver/implementation/driver_helpers.clj |
Updates feature support declarations via driver/database-supports?. |
drivers/starburst/src/metabase/driver/implementation/connectivity.clj |
Updates JDBC spec generation for driver version, impersonation, and explicit prepare behavior. |
drivers/starburst/resources/metabase-plugin.yaml |
Updates plugin version and exposes new connection options in UI metadata. |
drivers/starburst/deps.edn |
Bumps io.trino/trino-jdbc dependency version. |
app_versions.json |
Updates pinned versions (Trino/Clojure/Metabase). |
README.md |
Updates local dev/testing notes (JDK range, optimized prepared statements testing). |
Makefile |
Updates build/test flow, Metabase clone behavior, adds optimized test target, and tweaks FE build steps. |
CHANGELOG.md |
Adds 6.0.0/6.1.0 release notes and updates compare links. |
.gitignore |
Adjusts metabase repo ignore pattern to be repo-root anchored. |
.github/workflows/ci.yml |
Extends CI timeout and adds Metabase initialization step. |
.github/actions/init-dependencies/action.yml |
Bumps Node.js setup default from 16 to 18. |
Comments suppressed due to low confidence (1)
drivers/starburst/src/metabase/driver/implementation/connectivity.clj:23
clojure.tools.loggingis required but not used in this namespace. Consider removing the require to avoid lint noise.
(:require [clojure.set :as set]
[clojure.string :as str]
[clojure.tools.logging :as log]
[metabase.api.common :as api]
[metabase.db.spec :as mdb.spec]
[metabase.driver.sql-jdbc.common :as sql-jdbc.common]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.util.i18n :refer [trs]]))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Initialize dependencies | ||
| uses: ./.github/actions/init-dependencies | ||
| id: init-dependencies | ||
| with: | ||
| java-version: ${{ matrix.runners.java_version }} | ||
| java-architecture: ${{ matrix.runners.architecture }} | ||
| clojure-version: ${{ env.CLOJURE_VERSION }} |
There was a problem hiding this comment.
The workflow references matrix.runners.*, but this job does not define a strategy.matrix. This will resolve to empty/undefined values and break setup-java/dependency initialization. Define a matrix or replace these inputs with concrete values or env vars.
| (defn handle-execution-error | ||
| [e details] | ||
| (let [message (.getMessage e) | ||
| execute-immediate (get details :prepared-optimized false)] | ||
| (cond | ||
| (and (clojure.string/includes? message "Expecting: 'USING'") execute-immediate) | ||
| (throw (Exception. msg/STARBURST_INCOMPATIBLE_WITH_OPTIMIZED_PREPARED)) | ||
| :else (throw e)))) |
There was a problem hiding this comment.
handle-execution-error calls clojure.string/includes?, but this namespace isn't required in metabase.driver.starburst. This will fail to compile with No such namespace: clojure.string. Add [clojure.string :as str] to the ns requires (and update calls accordingly) or otherwise ensure the namespace is loaded.
| (defn impersonate-user | ||
| [conn] | ||
| (if | ||
| (clojure.string/includes? (.getProperty (.getClientInfo conn) "ClientInfo" "") "impersonate:true") | ||
| (let [email (get (deref api/*current-user*) :email)] | ||
| (.setSessionUser (.unwrap conn TrinoConnection) email)) | ||
| nil)) | ||
|
|
||
| (defn remove-impersonation | ||
| [conn] | ||
| (if | ||
| (clojure.string/includes? (.getProperty (.getClientInfo conn) "ClientInfo" "") "impersonate:true") | ||
| (.clearSessionUser (.unwrap conn TrinoConnection)) | ||
| nil)) |
There was a problem hiding this comment.
The impersonation detection checks (-> conn .getClientInfo (.getProperty "ClientInfo" ...)), but the connection property being set in connection-details->spec is :clientInfo (lowercase) and JDBC client-info keys are case-sensitive. As written, this is likely to never match and impersonation won't be applied/cleared. Use the correct key (and ideally access it consistently via getClientInfo(String) or the TrinoConnection API).
| (ns metabase.driver.implementation.messages "Starburst messages") | ||
|
|
||
| (def STARBURST_INCOMPATIBLE_WITH_OPTIMIZED_PREPARED "\"Optimized prepared statements\" require Starburst Galaxy, Starburst Enterprise (version 420-e or higher), or Trino (version 418 or higher)") | ||
| (def STARBURST_MAYBE_INCOMPATIBLE ". If the database has the \"Optimized prepared statements\" option on, it require Starburst Galaxy, Starburst Enterprise (version 420-e or higher), or Trino (version 418 or higher)") |
There was a problem hiding this comment.
Grammar: the message says "it require"; this should be "it requires" for readability.
| (def STARBURST_MAYBE_INCOMPATIBLE ". If the database has the \"Optimized prepared statements\" option on, it require Starburst Galaxy, Starburst Enterprise (version 420-e or higher), or Trino (version 418 or higher)") | |
| (def STARBURST_MAYBE_INCOMPATIBLE ". If the database has the \"Optimized prepared statements\" option on, it requires Starburst Galaxy, Starburst Enterprise (version 420-e or higher), or Trino (version 418 or higher)") |
| (defmethod load-data/do-insert! :starburst | ||
| [driver spec table-identifier row-or-rows] | ||
| (let [statements (ddl/insert-rows-ddl-statements driver table-identifier row-or-rows)] | ||
| (with-open [conn (jdbc-spec->connection spec)] | ||
| (doseq [[^String sql & params] statements] | ||
| (try | ||
| (with-open [^PreparedStatement stmt (.prepareStatement conn sql)] | ||
| (sql-jdbc.execute/set-parameters! driver stmt params) | ||
| (let [tbl-nm ((comp last :components) (into {} table-identifier)) | ||
| rows-affected (.executeUpdate stmt)] | ||
| (println (format "[%s] Inserted %d rows into starburst table %s." driver rows-affected tbl-nm)))) | ||
| (catch Throwable e | ||
| (throw (ex-info (format "[%s] Error executing SQL: %s" driver (ex-message e)) | ||
| {:driver driver, :sql sql, :params params} | ||
| e)))))))) | ||
| [driver ^Connection conn table-identifier rows] | ||
| (dorun | ||
| (pmap | ||
| (fn [rows] | ||
| (let [statements (ddl/insert-rows-dml-statements driver table-identifier rows)] | ||
| (doseq [[^String sql & params] statements] | ||
| (assert (empty? params)) | ||
| (try | ||
| (with-open [stmt (.createStatement conn)] | ||
| (let [[_tag _identifier-type components] table-identifier | ||
| table-name (last components)] | ||
| (.execute stmt sql) | ||
| (log/infof "[%s] Inserted %d rows into %s." driver (count rows) table-name))) | ||
| (catch Throwable e | ||
| (throw (ex-info (format "[%s] Error executing SQL: %s" driver (ex-message e)) | ||
| {:driver driver, :sql sql} | ||
| e))))))) | ||
| (partition-all 500 rows)))) |
There was a problem hiding this comment.
load-data/do-insert! uses pmap but shares a single java.sql.Connection (conn) across parallel threads. JDBC connections/statements are generally not thread-safe, so this can cause intermittent failures or corrupted behavior. Either avoid parallelism here or create/borrow a separate connection per parallel task.
| (assoc :source "Starburst Metabase 6.1.0") | ||
| (assoc-if :clientInfo "impersonate:true" (:impersonation details-map)) | ||
| (assoc-if :explicitPrepare "false" (:prepared-optimized details-map)) | ||
| (dissoc (if (remove-role? details-map) :roles :test)) |
There was a problem hiding this comment.
(dissoc (if (remove-role? details-map) :roles :test)) is hard to read and uses :test as a placeholder key to remove when no role should be removed. This obscures intent; use a conditional dissoc (or cond->) to remove :roles only when needed.
| (dissoc (if (remove-role? details-map) :roles :test)) | |
| (cond-> (remove-role? details-map) | |
| (dissoc :roles)) |
| cd metabase | | ||
| yarn build-static-viz | |
There was a problem hiding this comment.
The Initialize Metabase step uses | at the end of each line, which creates pipes/subshells and prevents cd metabase from affecting subsequent commands. Replace the pipes with proper line breaks and/or && so yarn build-static-viz runs inside the metabase directory.
| cd metabase | | |
| yarn build-static-viz | | |
| cd metabase | |
| yarn build-static-viz |
| ;; set session time zone if defined | ||
| (.setTimeZoneId underlying-conn (get options :session-timezone)))) | ||
| (try | ||
| (.setReadOnly conn true) |
There was a problem hiding this comment.
do-with-connection-with-options unconditionally sets the connection to read-only. This ignores the :write? option and can break code paths that legitimately need a writable connection (e.g., DDL/data loading during tests or sync). Set read-only based on :write? (e.g., only when write? is false).
| (.setReadOnly conn true) | |
| (.setReadOnly conn (not write?)) |
|
|
||
| (defmethod ddl/insert-rows-dml-statements :starburst | ||
| [driver table-identifier rows] | ||
| (def %rows rows) |
There was a problem hiding this comment.
(def %rows rows) introduces a global var as a side effect each time this method runs. This looks like leftover debugging and can leak large data into memory / interfere with REPL/test runs. Remove it or replace with scoped logging if needed.
| (def %rows rows) |
This PR brings the Starburst release/6.1.0 branch back onto master.
Why this matters:
Main driver behaviors restored on this line: