Prepare and test your skills

Prepare and test your skills

Preparing data for visualization means connecting dashboards to governed, fast data in BigQuery (opens in a new tab) so business users see consistent answers without slow queries. Traffic flows from the business intelligence (BI) tool to the BigQuery API, then to in-memory acceleration when data is cached, while uncached stages fall back to standard slots without failing the query. Identity flows from OAuth tokens or service accounts to BigQuery, and preparation work such as pre-joins and aggregates flows from pipelines into tables that dashboards read. Effective data visualization (opens in a new tab) therefore depends on acceleration, secure access, precalculation, tuning, and masking working together.
BigQuery BI Engine (BI Engine) is a fast, in-memory analysis service that accelerates interactive dashboard queries to sub-second response with high concurrency. BI Engine sits behind the BigQuery API and serves cached columns and partitions from memory, so repeated dashboard queries avoid re-scanning storage. BI Engine uses a vectorized runtime and dictionary run-length encoding to compress cached data while preserving authorized views, column-level security, and data masking.
BI Engine reservations are separate memory allocations managed per project and region, sized from 1 to 250 GiB and billed per GiB per hour with a supported BigQuery edition. BI Engine caches only the queried parts of columns and partitions rather than whole tables, and administrators can let BigQuery choose what to cache or designate preferred tables to protect critical dashboards. When memory is full, BI Engine offloads least-recently accessed partitions and columns, and a multi-table or materialized-view query accelerates only when every table it touches is preferred. Data layout controls memory needs: partitioning by time lets dashboards load only recent partitions, clustering orders rows to improve pruning, and materialized views pre-join and pre-aggregate into one flat table. Stale materialized views are recommended for best performance because they avoid recomputation on every refresh.
Secure access from BI tools to BigQuery combines OAuth 2.0 authentication, Identity and Access Management (IAM) authorization, and private network isolation. Google's OAuth 2.0 server issues temporary access tokens with an associated scope, and the tool presents that token when calling the public BigQuery REST API and Storage Read API over the internet. Tools with native integration, such as Looker, Looker Studio, and Tableau, use this direct API path, while other tools connect through Magnitude Simba ODBC and JDBC drivers without custom API code.
IAM decides who can run jobs and who can read data. Datasets are child resources of projects, and tables inherit permissions from their dataset, so project roles affect job execution while dataset roles affect data access. For least privilege, administrators create functional groups, grant only required roles, minimize basic Owner, Editor, and Viewer roles, and give BigLake connection service accounts storage access while removing direct Cloud Storage access from dashboard users. Hybrid paths extend the same model outside Google Cloud: hosts with external IPs reach BigQuery over the internet, Compute Engine virtual machines (VMs) with only internal IPs use Private Google Access enabled subnet-by-subnet in a Virtual Private Cloud (VPC) network, and on-premises hosts use Private Google Access over Cloud VPN or Cloud Interconnect. Federated connections let BigQuery query data that stays outside, including Amazon S3, Azure Blob Storage, Cloud SQL, Spanner, AlloyDB, and SAP Datasphere, while VPC Service Controls adds a virtual boundary that restricts API use to selected networks even when IAM would allow the call.
Exam tip: A join or materialized-view query uses BI Engine only when every table it touches is preferred, including both the view and its base tables.
Precalculated fields are aggregates, joins, filters, and derived values computed once upstream so dashboards read ready results instead of recomputing them. Data flows from prepared tables into a unified governed model, and from the model to Explores, dashboards, and embedded analytics, so a logic change made once flows automatically to every dependent visualization. This pattern lowers latency for repeated reporting but creates storage overhead and a freshness dependency tied to the last refresh.
BigQuery materialized views physically store a SQL result on disk and refresh in the background, while logical views store only query text and re-execute every time. BigQuery precomputes views when base tables change and merges stored rows with deltas at query time, so queries stay consistent without a manual pipeline. Only incremental materialized views support smart tuning, where BigQuery automatically reroutes qualifying base-table queries to the view.
| View type | SQL support | Smart tuning reuse |
|---|---|---|
| Incremental materialized view | Limited supported syntax | Supported; qualifying base-table queries reroute to the view |
| Non-incremental materialized view | Broader syntax | Not supported |
Refresh pipelines separate orchestration from processing. Cloud Composer, the managed Airflow service, schedules flows as directed acyclic graphs (DAGs) that trigger processing but do not transform data themselves. Dataflow, which executes Apache Beam batch and streaming pipelines across auto-provisioned workers, reads from sources such as Cloud Storage and writes directly to BigQuery. Scheduled refresh with BigQuery Data Transfer Service fits analysts who tolerate delay, while streaming refresh with Dataflow fits near-instant needs with exactly-once processing by default. Validation with the open-source Data Validation Tool compares counts, sums, and averages on both sides without moving full tables, which is required when BigQuery cannot join across regions.
Troubleshooting poor queries means separating data-layout problems from capacity contention and then fixing the dominant cause. In BigQuery, high bytes read with selective filters points to missing pruning, while high shuffle points to joins and aggregations moving too much data between stages. The execution graph reveals slot contention and shuffle quota issues, while Cloud Monitoring, administrative resource charts, and Gemini Cloud Assist track resource use over time.
Efficient SQL follows one principle: queries that do less work perform better. Filtering earlier, projecting only needed columns, and avoiding joins that explode output rows reduce bytes read, shuffled, and written. Slots are proprietary capacity units required to execute each query stage. On-demand pricing uses a shared pool defaulting to 2,000 slots per project with unbilled bursting, billed by bytes processed. Capacity-based pricing uses dedicated reservations starting at 100 slots with fixed commitments plus autoscaling slots. Larger pools help most for large, complex, or highly concurrent workloads, but more slots do not always make a single query faster. In Cloud SQL for PostgreSQL and AlloyDB, diagnosis pairs slow-query logs with execution plans and checks when vacuum, reindex, and index defragmentation last ran, because stale statistics cause poor join orders and too many read replicas can hinder VACUUM.
Protecting visualization data combines identity governance, fine-grained access, and de-identification so each user sees only what is allowed. BigQuery resources form a hierarchy of organization, project, dataset, table, column, and view, where tables inherit dataset permissions. Authorized views let users query a view without read access to base tables, with access flowing from the user to the view and then from the view to the base tables. Column-level security uses Dataplex policy tags such as 1_Sensitive, 2_Private, and 3_Confidential, while row-level security filters rows per requesting identity.
A Cloud DLP de-identification pipeline detects personally identifiable information (PII) with an inspection template and transforms it with a de-identification template before storage. Sensitive Data Protection inspects content using infoTypes such as email and phone, then applies masking, tokenization, surrogate replacement, redaction, or generalization. Storage de-identification scans Cloud Storage files via a DlpJob and writes sanitized copies to a separate output bucket that acts as a trust boundary. Dynamic data masking obfuscates BigQuery column values when a query runs based on the caller's IAM permission on the Dataplex policy tag, while stored values remain unchanged.
| Control | What restricted identity receives | Choose when |
|---|---|---|
| Column-level access control | No access; query fails if column selected | Attribute must be fully hidden |
| Dynamic data masking | Same column with obfuscated values | Column must stay present but hidden |
| Row-level security | Only allowed rows | Restriction depends on row values |
Continue with this study guide: Preparing data for visualization
Preparing data for AI and machine learning (ML) is the process of turning raw operational data into clean, reusable features and searchable vectors that train models and ground predictions consistently. Raw data flows from operational sources into ingestion tools, then through transformation logic, and finally into training tables, a central feature store, or a vector index. On Google Cloud, BigQuery handles tabular SQL transformation, Dataflow handles batch and streaming transformation, and BigQuery ML applies automatic preprocessing during training. Performance optimization (opens in a new tab) depends on choosing the right pipeline, storage format, lineage practice, and retrieval index for the workload.
Transformation pipelines from raw sources to training features separate where data comes from from how it is moved and reshaped for model use. Sources include operational databases such as Cloud SQL, Spanner, AlloyDB for PostgreSQL, and Firestore, data lakes such as Cloud Storage with BigLake, streaming platforms such as Pub/Sub and Dataflow, and external APIs. For each source, data flows from the source system into an ingestion tool and then into BigQuery or Cloud Storage storage optimized for ML training, separate from the operational source.
Tool choice depends on latency, volume, and reuse needs. Dataflow (opens in a new tab) processes data from many sources in batch and stream with ML-component integration, and it combines with Eventarc for event-driven architectures where changes trigger processing. Dataform automates SQL-based transformations for extraction, loading, and transformation (ELT) workflows after raw data lands in BigQuery staging tables. BigQuery itself performs in-warehouse SQL transformation for frequently accessed structured data, where materialized tables provide faster training reads than views or subqueries. Feature logic covers scaling numeric ranges, encoding categorical strings to numeric vectors, handling missing values, and creating derived signals such as bucketed ranges or crossed categories. Vertex AI Feature Store centralizes the resulting features in BigQuery tables or views for reuse, so the same definitions support training and serving without duplicate engineering.
Automatic preprocessing during BigQuery ML training is the default transformation that runs during training through the CREATE MODEL statement without custom code. Automatic preprocessing consists of missing-value imputation followed by feature transformation, and the same statistics learned during training are automatically applied during prediction. This behavior ensures that training and serving see consistent feature values even when prediction rows contain nulls or unseen categories.
Missing-data handling treats NULL values during training as missing, while prediction treats both NULL and unseen values as missing. Numeric columns replace nulls with the column mean, one-hot encoded columns map nulls to an added category, and TIMESTAMP and STRUCT columns apply type-specific rules per field. Default transformations standardize numeric types and one-hot encode non-numerical columns, except boosted tree, random forest, and k-means models which use different rules.
| Column type | Training imputation | Prediction imputation |
|---|---|---|
| Numeric | NULL replaced with column mean | NULL replaced with column mean |
| One-hot / Multi-hot encoded | NULL mapped to added category | NULL mapped to added category; unseen value weight is 0 |
TIMESTAMP and STRUCT | Type-specific rules per extracted field | Same statistics reapplied at prediction |
Custom preprocessing with the TRANSFORM clause runs in addition to automatic preprocessing. The clause takes raw input columns, applies manual functions, and passes only transformed outputs to training, so the model never sees untransformed values. Scalar functions operate on a single row, table-valued functions operate on all rows, and analytic functions require an empty OVER() clause so BigQuery ML can capture dataset-wide statistics during training and reapply them during prediction. Common functions include ML.IMPUTER for cleanup, ML.BUCKETIZE and quantile variants for binning, scaler and normalizer functions for numeric scale, encoder functions for categorical vectors, and ML.FEATURE_CROSS and ML.NGRAMS for derived and text features.
Storage, partitioning, and read paths for ML workloads determine where training data lives, what file format it uses, and how queries reach it during iterative training and batch prediction. BigQuery separates storage, compute, and memory into independently scaled services, while Cloud Storage holds data-lake files that feed training jobs directly or through BigQuery tables. Compute is measured in slots managed in reservations, memory comes from a remote distributed service, and table data lives in a distributed file system where it is compressed, encrypted, and replicated without consuming query slots.
Columnar formats and file layout in Cloud Storage control scan efficiency. Parquet and Optimized Row Columnar (ORC) organize data by column, which allows faster analytical access compared to row-oriented JavaScript Object Notation (JSON) or comma-separated values (CSV) files. A Hive partitioned layout places files in directory prefixes keyed by partitioning columns, so queries that filter on those columns can prune partitions and skip entire directories. File design must balance file count against file size, because too many tiny files increase metadata overhead while very large files can limit parallelism.
| Format group | Storage behavior | Query behavior for ML scans |
|---|---|---|
| Parquet, ORC | Columnar encoding with compression and column statistics | Much better performance because only needed columns are read and partitions can be pruned |
| JSON, CSV | Row-oriented text without columnar encoding | Slower performance because full rows and files are typically scanned |
The BigQuery Storage Read API can read both BigQuery tables and BigLake tables, supports filtering and fine-grained access control, and fits stable consumers that repeatedly scan large feature sets. Direct Cloud Storage APIs read bucket objects directly but do not allow filtering or fine-grained access control. When BigLake queries cannot meet requirements, the supported path is to convert exposed data to BigQuery storage and redefine authorized views, which unlocks materialized views and Business Intelligence (BI) Engine acceleration without disrupting consumers.
Versioning, lineage, and reproducibility link every training run to the exact code, dataset snapshot, transformations, parameters, and metrics that produced it. This linkage is built from Vertex ML Metadata for experiment-level lineage, Knowledge Catalog for organization-wide governance, and Model Registry for model versions, combined with reproducible storage and pipeline practices. Together, Git for code plus metadata plus registry versions mean code, data, and model changes each have an independent, queryable history.
Lineage tracking connects data sources, transformations, parameters, metrics, and artifacts so any experiment can be audited and rerun. Vertex ML Metadata logs metadata about sources and parameters, Experiments on Vertex AI builds linkage across objects, and Vertex AI TensorBoard visualizes runs by loss, accuracy, and embeddings. Repeatable inputs require separating ML training storage from operational sources and freezing the data actually used, with materialized data preferred over views or subqueries for speed and reproducibility. Vertex AI managed datasets create a clear link between frozen data and custom-trained models and provide train, test, and validation splits. Training-serving skew happens when offline features differ from online features, so Vertex AI Feature Store serves both paths from the same logic by flowing data from BigQuery historical storage to offline training and from the online store to serving.
Preparing unstructured data for embeddings and retrieval-augmented generation (RAG) is the pipeline that turns raw PDFs, HTML, images, and other files into cleaned chunks, vectors, and indexes that ground generative answers. Data flows from external sources to Cloud Storage buckets, through Pub/Sub triggers, through preparation compute, and then to a managed datastore or vector index where indexed vectors and metadata serve filtered retrieval. The same embedding model must be used for document chunks and user queries so both live in the same vector space.
Event-driven ingestion starts downstream work without polling:
Pub/Sub subscriptions can buffer unacknowledged messages for up to 7 days, so processing can resume with low risk of loss. Cleaning runs before managed parsing with three intents: filter to drop noise, transform to normalize formats, and redact to mask sensitive values before storage. Metadata enrichment tags each document with product line, author, location, and document type, and chunking preserves headings, tables, and document order for precise search.
Embedding generation and vector search in BigQuery turn chunks into searchable vectors with SQL. AI.EMBED generates a single embedding for on-demand comparisons, AI.GENERATE_EMBEDDING creates a table of embeddings per row, and autonomous embedding generation maintains an embedding column automatically. VECTOR_SEARCH fits large-scale semantic or hybrid search, AI.SEARCH fits tables with autonomous embeddings, and AI.SIMILARITY fits small comparisons with cosine similarity. A BigQuery vector index created with CREATE VECTOR INDEX accelerates search with Approximate Nearest Neighbor at the tradeoff of reduced recall. For serving, Vertex AI Vector Search fits low-latency large-scale serving, Vertex AI Search fits fully managed search without direct embedding access, AlloyDB and Cloud SQL with pgvector fit operational SQL access, and BigQuery fits large analytical SQL access.
Exam tip: Cloud Run functions creates JSONL metadata but does not chunk or embed; parsing, chunking, and automatic embedding happen in the managed datastore after it pulls both buckets.
Continue with this study guide: Preparing data for AI and ML
Sharing data (opens in a new tab) means letting authorized collaborators query data without copying it into uncontrolled environments while recording every access. BigQuery sharing through Analytics Hub and BigQuery data clean rooms provide the controlled framework for cross-organization collaboration, while Cloud Storage and Looker Action Hub extend sharing to objects and dashboards. Cloud Audit Logs, Cloud Logging, and Cloud Monitoring provide the audit trail that proves who accessed data and whether sharing rules were followed.
A secure sharing method defines where data lives, who can query it, and what is allowed to leave the boundary. BigQuery sharing lets a provider publish datasets once and lets subscribers query them across organizations without moving copies, while data clean rooms add a privacy-enforced environment where parties can join sensitive data under strict rules. Reusable sharing through Looker Action Hub sends results directly from dashboards into built-in destinations, so data flows from Looker to the destination without manual export.
| Sharing method | What is shared | Privacy boundary |
|---|---|---|
| BigQuery sharing (Analytics Hub) | Live datasets and listings for cross-organization analytics | Subscriber queries provider data under provider IAM without copying |
| BigQuery data clean rooms | Joined analysis across parties with restricted outputs | Collaboration happens inside a governed clean room |
| Cloud Storage IAM sharing | Buckets and objects governed by bucket-level policies | Access flows from bucket policy to principals |
Least-privilege access means every identity receives only minimum permission for its role. IAM maps predefined or custom roles to users, groups, or service accounts, refines grants with IAM Conditions, and adds row-level and column-level security inside datasets. The finance-marketing pattern shows separation: IT staff receive Storage Legacy Bucket Owner to manage the bucket and list contents but not view object data, while analysts receive Storage Object User to upload, view, update, and delete objects. A sharing rule must also control exfiltration. VPC Service Controls creates a service perimeter around data resources with ingress and egress rules, firewall rules restrict traffic under deny-all-by-default, customer-managed encryption keys (CMEKs) control keys at rest, HTTPS protects calls in transit, and controls such as domain restricted sharing and public access prevention keep sharing inside authorized domains.
Publishing datasets is the publication of BigQuery assets inside and across organizations without creating unmanaged copies. BigQuery Analytics Hub is the publication layer where a publisher creates a data exchange as a container, publishes listings that describe specific assets, and consumers discover and subscribe. Because administration stays in the publisher project, access can be granted, changed, or revoked centrally while control of source data remains with the owner.
A publisher builds sharing in a fixed order:
Subscribing creates a read-only linked dataset in the subscriber project that is a live pointer to shared data, so queries always see current publisher data without a copy. When egress is restricted, copy, clone, export, snapshot, CREATE TABLE AS SELECT, and transfer operations on the linked dataset become unavailable. A Pub/Sub topic listing shares real-time streams instead of static snapshots, with data flowing from the publisher-owned topic to authorized subscribers. A data clean room allows organizations to bring governed datasets together for joint analysis without exchanging raw copies. Google Cloud Marketplace commercializes an existing listing as a paid product for monetization without changing the trust model.
Location and tenant design form additional boundaries. Single-region storage replicates across zones, while multi-region storage replicates across regions. Colocation preserves performance: federated Cloud SQL, Spanner, and Bigtable sources should be in the same location as the BigQuery dataset. For tenant isolation, authorized views support up to 2,500 authorized resources per dataset and automatically inherit base-table column policies, while subset tables have no dataset limit and can use per-tenant partitioning but must have policies reapplied. Billing follows a zero-copy rule: the publisher pays for storage and publish throughput, while the subscriber pays for queries and subscribe throughput, with no extra charge for exchanges or listings. Publisher visibility comes from provider usage metrics, Cloud Logging, audit logs, and INFORMATION_SCHEMA views, with historical snapshots queryable for up to seven days.
Exam tip: Storage Legacy Bucket Owner can list a bucket and manage its policy but cannot view object data — however that manager can grant itself object access, so track permission changes in audit logs.
Publishing reports with Looker delivers governed metrics without exposing raw uncontrolled data. Looker is a business intelligence platform where data teams describe tables, joins, and business logic in LookML, and Looker generates SQL from that LookML when a user opens a Look, Explore, or dashboard. This creates a fixed dependency chain: the Explore depends on model and view files, the generated SQL depends on the Explore, and results flow back from the database to the visualization.
A model file names the database connection and declares available Explores, while a view file defines dimensions and measures for a table. An Explore combines views into a queryable starting point, so traffic flows from the user-selected Explore to joined views to the database as generated SQL. Looker development separates personal work from shared content: a developer works in Development Mode on an isolated Git branch, and only after commit and deployment does content become visible in Production Mode. Secure connections start with encrypted transit, tunnel servers for Secure Shell tunnels, and allow lists for external access, with least-privilege database grants. The access_filter parameter works with user attributes to enforce row-level, column-level, or field-level security, so two users querying the same Explore receive different rows. Automating refresh uses versioned orchestration where Git commits trigger Cloud Build, artifacts stage in Cloud Storage, continuous delivery promotes to preproduction and production, and Managed Airflow, Cloud Scheduler, or Cloud Run functions launch Dataflow jobs that write to BigQuery reporting tables.
Configuring Data Studio for enterprise reporting means connecting governed sources to reusable dashboards and controlling access, performance, and distribution. Data Studio is a self-service business intelligence platform for visualizations, dashboards, and reports. Data Studio connects directly to BigQuery tables, views, and custom queries, and Data Studio Pro adds IAM management, team workspaces, and mobile support. The connector workflow runs in order: create a report, select the BigQuery connector to create or reuse a data source, configure access for a table or custom SQL with separate projects for data and billing when needed, then add to canvas.
Managing access depends on the credential mode for the data source. To query BigQuery, an identity needs BigQuery Data Viewer to read data and BigQuery Job User to run jobs in the billing project.
| Credential mode | Who needs BigQuery roles | Behavior for viewers |
|---|---|---|
| Owner's credentials | Only the data source owner | Viewers see charts without their own access; default mode |
| Viewer's credentials | Every report viewer | Each viewer queries as themselves |
| Service account credentials | Only the configured service account | Centralizes access in one managed identity |
BigQuery BI Engine improves Data Studio performance while reducing compute costs, and teams reserve capacity for dashboards that need faster response. Exploring query results from the BigQuery console creates dashboards backed by temporary tables stored for up to 24 hours, and charts built this way can visualize a maximum of 5,000 rows. In full Data Studio reports backed by BigQuery datasets, up to 2 million rows can be viewed and up to 750,000 rows can be exported from a chart. If the organization uses VPC Service Controls, the Data Studio service account must have rules that allow bigquery.googleapis.com, and every query can be audited through INFORMATION_SCHEMA.JOBS with requestor set to looker_studio.
Continue with this study guide: Sharing data
BigQuery BI Engine (BI Engine) is a fast, in-memory analysis service that serves cached columns and partitions from memory so repeated dashboard queries avoid re-scanning storage and achieve sub-second response with high concurrency. Reservations are separate memory allocations managed per project and region from 1 to 250 GiB, caching only queried parts of columns and partitions with optional preferred tables to protect critical dashboards. When memory is full, BI Engine offloads least-recently accessed partitions and columns and uncached stages fall back to standard slots without failing the query.
BigQuery materialized views physically store a SQL result on disk and refresh in the background, while only incremental materialized views support smart tuning where BigQuery automatically reroutes qualifying base-table queries to the precomputed result. Non-incremental materialized views support broader SQL syntax but do not support smart tuning reuse. Stale materialized views are recommended for best performance because they avoid recomputation on every refresh.
BigQuery Analytics Hub (Analytics Hub) is the publication layer where a publisher creates a data exchange as a container and publishes listings that describe specific assets for discovery and subscription. Subscribing creates a read-only linked dataset in the subscriber project that is a live pointer to shared data without a copy. The publisher pays for storage and publish throughput while the subscriber pays for queries and subscribe throughput, with no extra charge for exchanges or listings.
Last updated