Connecting to a BigQuery database
Requirements
- A Google BigQuery account
- Installation of the BigQuery JDBC driver: see the page BigQuery connector
Connecting to a BigQuery database
To retrieve data from a BigQuery database :
- In the Create a new data model box, click the BigQuery button in the Reports section.

➡ The BigQuery dialog box appears. - Select the desired connection mode.
- Manual connection mode
The connection will be visible in the data source only.- Enter the connection information:
- Host: The BigQuery host address.
- Port: The database port.
- Project: The name of your BigQuery project.
- Authentication: The authentication method to use (see Authentication).
- Options: Additional login options to configure authentication and/or login settings.
- Click the Connection button.
- Enter the connection information:
- Named connection mode
The connection will be visible in the connection manager and can be used by all data sources.- Click Select: the Database Connection Manager is displayed.
- You can :
- Select an existing connection from the list. Click OK.
- Create a new connection as described on the Add a named connection.
- Click on the Connection button.
- In the Context Selection box that appears, select the catalogues you wish to import.
➡ The data loads. - In the Query tab, create a query using the Wizard :
- Select the table to be used in the left-hand panel.
➡ The corresponding columns are displayed in the right-hand panel. - You can remove columns by unchecking the corresponding boxes. The
button selects all. - You can define rules on columns: select the column then click the
button at the top right of the columns and define the rule. The rule is added to the table below the columns.
- Select the table to be used in the left-hand panel.
- Click Options if you wish to modify the advanced properties of the database. See the options paragraph below.
- In the Results tab, preview the results of the defined query. See the Preview page for more details.
- You can also add data transformations. See the Transform data page for more details.
- Once you are happy with the result, click Next to configure the data model.
Options
| Query timeout | Maximum query duration in seconds (default is 60 seconds). |
|---|---|
| Row fetch size | Number of rows to be fetched from the database. If set to 0, the number takes the JDBC driver "fetchsize" value. |
| Number of retries on error | Number of times the query is repeated in the event of an error. |
| Persist error on schedule | Used to generate a cube containing the error. The whole process will fail later, but this avoids having to redo the job (and being in error again) for all the tasks. |
| Incremental data mode | Incremental data mode is used to feed the cube incrementally: each time the cube is refreshed, only the new data is brought back compared with the previous refresh. The reference column is entered in the Reference column field below. |
Editing the query
You can edit the query manually by selecting Advanced....
The query generated by the wizard is displayed.
- Click Edit.

- Modify the query as required.
- Click Apply.
You can save the query you have entered for later use. To do this:
- Click the Favorites button .
- Select Add to favorites then enter the name you want to give to this query.
➡ The query will be available from the same Favorites menu.

It is also possible to access the modification history via the History button.
Authentication
There are several authentication methods for connecting to BigQuery.
Google Service Account (Service Auth)
For this authentication method, you will need to copy the .p12 or .json file to the DigDash server and specify two connection options using the Options button when configuring the connection:
- OAuthServiceAcctEmail: The email address of your Google Service Account
- OAuthPvtKeyPath: The path to the .p12 or .json file on the DigDash server
Pre-generated tokens
For this authentication method, you will need to specify several connection options via the options button when configuring the connection, the first option denotes whether you will be using an access or refresh token:
- OAuthAccessToken or OAuthRefreshToken: The access token or the refresh token respectively.
If you are using the refresh token you will also need :
- OAuthClientId: The client identifier.
- OAuthClientSecret: The client secret.
Default application identifiers
For this authentication method, make sure you have configured the "Application Default Credentials" on the "Google Identity Platform". No connection options are required.
Troubleshooting: advanced query
Depending on the data, doing a SELECT * on a BigQuery table in an advanced query will generate an error. This is due to metadata or data types specific to google.
To avoid this problem, you need to do a CAST as STRING on each column.
For example:
cast(ticket_id as STRING) as ticket_id
Only STRING, DATE and INT64 are available for CAST.
If you need a date in DATETIME format, you can CAST it as a STRING and then convert it in DigDash.