The Simplest Way to Make BigQuery and Databricks ML Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use bigquery and databricks ml together to train models on warehouse data. BigQuery stores huge tables, while Databricks ML runs training jobs and tracks models. Data teams move training sets from Google Cloud into Spark clusters for feature work. After training finishes, the cluster writes predictions back to the warehouse for business reports. How data and permissions flow in bigquery and databricks ml Moving data between these two platforms takes a few clear steps. First, the Spark c

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use bigquery and databricks ml together to train models on warehouse data. BigQuery stores huge tables, while Databricks ML runs training jobs and tracks models. Data teams move training sets from Google Cloud into Spark clusters for feature work. After training finishes, the cluster writes predictions back to the warehouse for business reports.

How data and permissions flow in bigquery and databricks ml

Moving data between these two platforms takes a few clear steps. First, the Spark cluster logs in to Google Cloud with a service account. Next, the connector runs a query or reads table blocks through storage APIs. For large jobs, the warehouse stages data in cloud storage buckets first. The compute cluster then reads those files in parallel across worker nodes. When the model scores new rows, the job writes results back through a staging bucket.

Permissions must match each step of this data flow. The service account needs read rights on source datasets and tables. It also needs permission to start query jobs in the warehouse project. If the job writes data back, the role needs write access on target tables. Cloud storage buckets used for staging also need read and write rules. Keeping these roles separate for read and write jobs lowers risk across teams.

Common security failures with shared keys and broad roles

Many teams start by sharing one service account key across a whole workspace. Data scientists paste this static JSON key into shared notebooks or cluster settings. Anyone who can run code on that cluster can use that powerful key. If a notebook leaks, an attacker gains full access to warehouse tables. Static keys also do not expire on their own, which creates long-term risk.

Broad roles make this shared key problem much worse. Teams often grant project editor or warehouse admin roles to fix permission errors fast. That lets a training job read sensitive tables it does not need. Worse, warehouse logs only show the shared service account name for every query. Security teams cannot tell which user or notebook ran a costly or risky read.

BigQuery IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping roles and network paths between both platforms

To fix these issues, replace static JSON keys with workload identity federation where possible. Give each project or team its own dedicated service account with narrow rights. Grant read access only to the exact dataset views needed for model features. Create a separate role for batch jobs that write predictions back to tables.

Network rules also keep data transfers safe between cloud accounts. Set up private network links or VPC service controls around your warehouse projects. Block public internet traffic from reading sensitive buckets or datasets. Turn on data masking rules for columns like emails, phone numbers, card numbers, and national IDs. Masking rewrites matched fields in query results before the training cluster reads the rows. Finally, tag every job with user metadata so audit logs show who ran each query.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does Databricks ML read data from BigQuery fast?

The Spark connector uses the storage read API to stream table blocks in parallel. This skips slow single-node exports and sends data straight to worker nodes.

Why do warehouse logs only show one service account for all notebook queries?

Clusters often use one shared service account to log in to Google Cloud. Every user on that cluster shares that single identity unless you separate access per user.

How can teams protect sensitive columns during model training?

Teams apply masking rules to fields like emails, phone numbers, card numbers, and national IDs. Masking rewrites matched fields in results before data leaves the warehouse.

The query runs. The emails stay hidden.