Google BigQuery
Catalog BigQuery projects, datasets, tables, views, columns and routines from INFORMATION_SCHEMA, with SQL lineage from views, routines and job history.
Capabilities
| Capability | Support | Notes |
|---|---|---|
| Tables, views & columns | Supported | INFORMATION_SCHEMA views are regional: replace region-eu with your dataset location. |
| Keys, constraints & indexes | Partial | |
| Procedures & functions | Supported | |
| Data lineage | Supported | Configure the BigQuery pre-processing rules in the SQL lineage bucket. |
| Lineage from query history | Supported | Statements collected from INFORMATION_SCHEMA.JOBS. |
| Business glossary links | Supported | |
| Data quality probes | Supported | |
| Data profiling | Supported | |
| Data classification | Supported | |
| Chat with your data | Supported |
Connection settings
Create the connection on the Blindata Agent from Settings > Agents > Connections with the connection wizard, choosing Google BigQuery in the technology step.
| Driver class | com.simba.googlebigquery.jdbc.Driver |
|---|---|
| JDBC URL | jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=my_project;OAuthType=0; |
| Authentication |
Service principal (shared technical user) User principal (personal credentials, BYOC) Ephemeral credentials (asked at each run)
|
| Crawling strategy | SQL or JDBC |
Connection properties
| Property | Description |
|---|---|
OAuthServiceAcctEmail | Service account email (OAuthType=0). |
OAuthPvtKey | Service account JSON key content. |
OAuthPvtKeyPath | Path of the service account key file attached to the connection. |
The Blindata Agent does not include this driver: download the vendor JDBC driver and copy the .jar into the agent drivers folder, as described in
Add JDBC drivers.
Driver properties can be added under Advanced settings in the connection wizard.
Prerequisites & permissions
- A Blindata Agent installed with network access to Google BigQuery.
- The vendor JDBC driver installed on the agent (see Add JDBC drivers).
- A service account with
roles/bigquery.metadataVieweron the projects or datasets to document. roles/bigquery.jobUseron the billing project to run extraction queries.roles/bigquery.resourceViewerto readINFORMATION_SCHEMA.JOBSfor query history.roles/bigquery.dataViewerfor data quality, profiling, classification and Chat with your data.
Set up metadata crawling
- Create the connection to Google BigQuery on the agent (see Connection settings) and use Test to verify it.
- Create or open the system that represents Google BigQuery in the catalog and link it to the connection.
- In the CRAWLING tab add a crawling job with strategy SQL or JDBC and, if needed, replace the default queries with the ones suggested below.
- Run a TEST to check the number of extracted objects, then RUN or schedule the job.
The job options and the column aliases of every extraction query are described in the Generic JDBC reference.
Suggested extraction queries
Both the JDBC strategy and the SQL strategy with the default queries work for tables, views and columns. Use the following routines query to import routines with their parameters.
Routines query
INFORMATION_SCHEMA.ROUTINES.routine_definition is the function body. Parameters live in INFORMATION_SCHEMA.PARAMETERS; aggregate them in a CTE, then LEFT JOIN onto INFORMATION_SCHEMA.ROUTINES so every routine gets a parameters JSON (or null). Replace the region qualifier (region-eu), or use project.dataset.INFORMATION_SCHEMA.* when you crawl a single dataset:
WITH routine_parameters AS (
SELECT
p.specific_catalog,
p.specific_schema,
p.specific_name,
TO_JSON_STRING(
ARRAY_AGG(
STRUCT(
p.parameter_name AS name,
p.data_type AS dataType,
p.ordinal_position - 1 AS positionIndex
)
ORDER BY p.ordinal_position
)
) AS ROUTINE_PARAMETERS
FROM `region-eu`.INFORMATION_SCHEMA.PARAMETERS AS p
WHERE UPPER(COALESCE(p.parameter_mode, 'IN')) IN ('IN', 'INOUT')
AND p.parameter_name IS NOT NULL
AND p.parameter_name != ''
GROUP BY
p.specific_catalog,
p.specific_schema,
p.specific_name
)
SELECT
r.specific_name AS SPECIFIC_NAME,
r.routine_catalog AS ROUTINE_CATALOG,
r.routine_schema AS ROUTINE_SCHEMA,
r.routine_name AS ROUTINE_NAME,
r.routine_type AS ROUTINE_TYPE,
r.routine_definition AS ROUTINE_DEFINITION,
rp.ROUTINE_PARAMETERS
FROM `region-eu`.INFORMATION_SCHEMA.ROUTINES AS r
LEFT JOIN routine_parameters AS rp
ON rp.specific_catalog = r.specific_catalog
AND rp.specific_schema = r.specific_schema
AND rp.specific_name = r.specific_name;
Lineage from query history
The agent can periodically extract executed statements from Google BigQuery and send them to Blindata, where the SQL lineage engine turns them into dataflows. See the ready-made extraction query in Scheduling and statements extraction.