How to Connect BigQuery to Looker

Galaxy Glossary

How do I connect BigQuery to Looker?

Securely links a Google BigQuery project to Looker so you can model, explore, and visualize warehouse data.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Description

Table of Contents

Why connect BigQuery to Looker?

Connecting unlocks Looker’s modeling layer on top of BigQuery’s scalable storage, allowing analysts to write LookML once and serve governed dashboards to every team.

What prerequisites must be in place?

Create a dedicated BigQuery service account, assign BigQuery Data Viewer & BigQuery Job User roles, and download the JSON key. In Looker, you’ll need admin rights to add connections.

How do I add the BigQuery connection in Looker?

Navigate to Admin → Connections → New Connection. Choose the bigquery dialect, upload the service-account JSON, enter the project ID, and test the connection.

How do I whitelist datasets for Looker?

Grant the service account access to each dataset with bigquery.dataViewer and bigquery.jobUser. Use the UI or run:

bq --project_id=my-proj --dataset_id=ecommerce \
add-iam-policy-binding \
--member="serviceAccount:looker@my-proj.iam.gserviceaccount.com" \
--role="roles/bigquery.dataViewer"

What LookML connection parameters matter most?

Set connection_type: "service_account", dialect: bigquery, and optionally additional_params: {use_standard_sql: "yes", maximumBillingTier: 10} for cost control.

How can I test with an ecommerce query?

SELECT c.name,
SUM(oi.quantity * p.price) AS lifetime_value
FROM `ecommerce.Customers` AS c
JOIN `ecommerce.Orders` AS o ON o.customer_id = c.id
JOIN `ecommerce.OrderItems` AS oi ON oi.order_id = o.id
JOIN `ecommerce.Products` AS p ON p.id = oi.product_id
GROUP BY c.name
ORDER BY lifetime_value DESC
LIMIT 10;

How do I optimize performance?

Enable Bi Engine on critical datasets, turn on Persistent Derived Tables (PDTs) with scheduled builds, and use aggregate awareness to reduce scan costs.

What are best practices for security?

Store the service-account JSON in Looker’s encrypted secrets manager, restrict its IAM roles to read-only, and rotate keys annually.

How do I monitor usage and cost?

Create a Looker Explore on the INFORMATION_SCHEMA.JOBS_BY_PROJECT view to track query counts, bytes processed, and errors per Looker user.

What next if the connection fails?

Verify the service account has bigquery.jobs.create permission, confirm the project ID matches, and check that private IP restrictions are not blocking Looker.

Why How to Connect BigQuery to Looker is important

How to Connect BigQuery to Looker Example Usage


SELECT c.email,
       COUNT(DISTINCT o.id)         AS orders,
       SUM(o.total_amount)          AS revenue
FROM   `ecommerce.Customers`  AS c
LEFT   JOIN `ecommerce.Orders` AS o ON o.customer_id = c.id
WHERE  c.created_at >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 YEAR)
GROUP  BY c.email
ORDER  BY revenue DESC
LIMIT  25;

How to Connect BigQuery to Looker Syntax


CONNECTION_NAME {
  dialect: bigquery
  connection_type: "service_account"          -- auth method
  project_name:      "my-ecommerce-prod"      -- GCP project
  dataset:           "ecommerce"              -- default dataset
  service_account_credentials_path: "/keys/looker-sa.json"
  additional_params: {
    use_standard_sql: "yes",                   -- legacy vs standard
    maximumBillingTier: 10,                    -- cost guardrail
    priority: "interactive"                    -- run priority
  }
  ssl: true                                     -- encrypt traffic
  timeout_seconds: 300                          -- optional
}

Common Mistakes

Frequently Asked Questions (FAQs)

Does Looker support BigQuery’s Standard SQL?

Yes. Set use_standard_sql: "yes" in the connection’s additional_params. LookML explores automatically use Standard SQL.

Can I restrict Looker to specific datasets?

Absolutely. Grant the service account access only to the required datasets and deny project-wide roles. This limits surface area and cost.

How do I enable Bi Engine for faster dashboards?

Open the BigQuery console, choose the project, click Bi Engine, and allocate memory to the datasets serving Looker. Re-run explores to leverage caching.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.