Skip to content
Snippets Groups Projects
Unverified Commit f37597fe authored by Ryan Senior's avatar Ryan Senior Committed by GitHub
Browse files

Merge pull request #6982 from cahlchang/fix-bigquery-socket-timeout

Fix parameters for Bigquery queries that take a long time.
parents 140d4bc8 03aaf627
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
[metabase.util.honeysql-extensions :as hx]
[toucan.db :as db])
(:import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
[com.google.api.client.http HttpRequestInitializer HttpRequest]
[com.google.api.services.bigquery Bigquery Bigquery$Builder BigqueryScopes]
[com.google.api.services.bigquery.model QueryRequest QueryResponse Table TableCell TableFieldSchema
TableList TableList$Tables TableReference TableRow TableSchema]
......@@ -44,7 +45,14 @@
;;; ----------------------------------------------------- Client -----------------------------------------------------
(defn- ^Bigquery credential->client [^GoogleCredential credential]
(.build (doto (Bigquery$Builder. google/http-transport google/json-factory credential)
(.build (doto (Bigquery$Builder.
google/http-transport
google/json-factory
(reify HttpRequestInitializer
(initialize [this httpRequest]
(.initialize credential httpRequest)
(.setConnectTimeout httpRequest 0)
(.setReadTimeout httpRequest 0))))
(.setApplicationName google/application-name))))
(def ^:private ^{:arglists '([database])} ^GoogleCredential database->credential
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment