BigQuery Simba JDBC Connect Private Service Connect

Viewed 346

We want to use the Simba JDCB driver to fetch data from our BigQuery datasets. Due to our company policy we have to use a Private Service Connect for the BigQuery API: https://bigquery-p.p.googleapis.com instead of the public available one (https://bigquery.googleapis.com). We have successfully connected the Private Service Connect via an Interconnect and are able to use the endpoint via curl and the URL is correctly translated to the IP of the Private Service Connect :

curl -v -H "Authorization: Bearer TOKEN" https://bigquery-p.p.googleapis.com/bigquery/v2/projects/OUR-PROJECT/datasets

Since our applications depends on the Simba JDCB driver (Version 1.2.21.1025) we have tried to use this Private Service Endpoint in the config by using:

  • Setting the URL of the data source: jdbc:bigquery://https://bigquery-psc.p.googleapis.com
  • Additionally setting the custom property RootURL to the endpoint

with the following code:

DataSource ds = new com.simba.googlebigquery.jdbc.DataSource();
ds.setURL("jdbc:bigquery://https://bigquery-p.p.googleapis.com");
ds.setCustomProperty("RootURL", "http://bigquery-p.p.googleapis.com");

But the connection is failing with the following stacktrace:

Exception in thread "main" java.sql.SQLException: [Simba][BigQueryJDBCDriver](100004) HttpTransport IO error : Connection refused: connect.
    at com.simba.googlebigquery.googlebigquery.client.BQClient.createAndTestClient(Unknown Source)
    at com.simba.googlebigquery.googlebigquery.client.BQClient.serviceAccountOAuth(Unknown Source)
    at com.simba.googlebigquery.googlebigquery.core.BQConnection.connect(Unknown Source)
    at com.simba.googlebigquery.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
    at com.simba.googlebigquery.jdbc.common.AbstractDataSource.getSimbaConnection(Unknown Source)
    at com.simba.googlebigquery.jdbc.common.AbstractDataSource.getConnection(Unknown Source)
Caused by: com.simba.googlebigquery.support.exceptions.GeneralException: [Simba][BigQueryJDBCDriver](100004) HttpTransport IO error : Connection refused: connect.
    ... 6 more
Caused by: com.simba.googlebigquery.support.exceptions.GeneralException: EXEC_JOB_EXECUTION_ERR
    at com.simba.googlebigquery.googlebigquery.client.BQClient.throwExecException(Unknown Source)
    at com.simba.googlebigquery.googlebigquery.client.BQClient.insertJob(Unknown Source)
    at com.simba.googlebigquery.googlebigquery.client.BQClient.prepare(Unknown Source)
    ... 6 more

Process finished with exit code 1

How we have to configure the Simba JDCB driver for BigQuery to point to a private api endpoint?

1 Answers

There is no such configuration on the JDBC driver. Therefore we had to implement a workarround by using a proxy and configure it on the System level:

System.setProperty("http.proxyHost", "IP_OF_THE_PROXY");
System.setProperty("http.nonProxyHosts", "*.p.googleapis.com");
Related