Reputation: 14549
I am trying to specify a the asia-northeast1
(Japan) location for the SIMBA BigQuery JDBC driver to use when querying a dataset in that location. For regional locations you must specify your location when querying:
If your data is in a location other than the US or EU multi-region, you must specify the location when you perform actions such as loading data, querying data, and exporting data. Specifying your location
I have tried setting my query string subname to:
//https://www.googleapis.com/bigquery/v2;ProjectId=mybqproject;OAuthType=3;Location=asia-northeast1
It's in Clojure, so the whole thing is here for context, but the same principles should apply for any JDBC connection.
(clojure.java.jdbc/get-connection
{:classname "com.simba.googlebigquery.jdbc42.Driver"
:subprotocol "bigquery"
;; OAuthType=3 means use Application Default Credentials
:subname "//https://www.googleapis.com/bigquery/v2;ProjectId=mybqproject;OAuthType=3"})
It doesn't appear as if the Location property is picked up (I just guessed about using Location
here, I couldn't see anything in the docs). I am able to successfully connect to and query against datasets in the US multiregion, so the configuration properties are correct but not Japanese ones. When I try and query a dataset in Japan I get this error:
CompilerException java.sql.SQLException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "Not found: Dataset mybqproject:mybqtable",
"reason" : "notFound"
} ],
"message" : "Not found: Dataset mybqproject:mybqtable"
},
I get this error in the BigQuery SQL console also when I don't explicitly set the Japan location. This indicates that the Japanese location is not being searched for this table.
How can I choose the Japanese location when using the Google BigQuery SIMBA JDBC driver?
Upvotes: 1
Views: 2814
Reputation: 14781
The Simba JDBC driver unfortunately doesn't support this feature yet, so you won't be able to use it that way.
https://www.simba.com/products/BigQuery/doc/JDBC_InstallGuide/content/jdbc/bq/options/intro-general.htm (processing location is not listed)
If possible, you could switch to using the BigQuery API and set the field jobReference.location
. Set it to the processing location you want, using the query job configuration. Note: this is marked as Experimental
so be careful.
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query
Upvotes: 1