Skip to content
Snippets Groups Projects
Unverified Commit cc9ca98f authored by metabase-bot[bot]'s avatar metabase-bot[bot] Committed by GitHub
Browse files

Add cancelation exception for vertica (#42047) (#42090)

parent 483b22b0
No related branches found
No related tags found
No related merge requests found
......@@ -713,12 +713,16 @@
;; [[metabase.query-processor.middleware.limit/limit-xform]] middleware, while statment is still
;; in progress. This problem was encountered on Redshift. For details see the issue #39018.
;; It also handles situation where query is canceled through [[qp.pipeline/*canceled-chan*]] (#41448).
(finally (try (.cancel stmt)
(catch SQLFeatureNotSupportedException _
(log/warnf "Statemet's `.cancel` method is not supported by the `%s` driver."
(name driver)))
(catch Throwable _
(log/warn "Statement cancelation failed.")))))))))))
(finally
;; TODO: Following `when` is in place just to find out if vertica is flaking because of cancelations.
;; It should be removed afterwards!
(when-not (= :vertica driver)
(try (.cancel stmt)
(catch SQLFeatureNotSupportedException _
(log/warnf "Statemet's `.cancel` method is not supported by the `%s` driver."
(name driver)))
(catch Throwable _
(log/warn "Statement cancelation failed."))))))))))))
(defn reducible-query
"Returns a reducible collection of rows as maps from `db` and a given SQL query. This is similar to [[jdbc/reducible-query]] but reuses the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment