Spark, Data Fusion, ELT, and AI
Professional Data Engineer · Lesson 9 of 23 · 1:00:41
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Google Cloud Professional Data Engineer exam, on the official exam guide. In this lesson: Spark and Hadoop on Managed Service for Apache Spark (formerly Dataproc), visual pipelines with Cloud Data Fusion, load jobs, the Storage Write API, external tables, and ELT in BigQuery, and AI enrichment with RunInference and BigQuery AI functions. Includes three original practice questions, with Cymbal Mobility, a fictional ride-hailing and scooter company, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Four teams, four needs
Cymbal Mobility's North American unit brings five years of Spark jobs written for Hadoop. The finance team, who do not write code, must connect a dozen business applications. Analysts want their transformations in SQL, inside BigQuery. And support wants each rider comment tagged with its topic and sentiment, automatically.
Spark and Hadoop
Managed Service for Apache Spark, formerly Dataproc, runs open source Spark and Hadoop tools, like Hive, without an administrator. Clusters start in minutes, so the usual pattern is ephemeral: create a cluster for a set of jobs, keep the data in Cloud Storage instead of HDFS, then delete the cluster. Autoscaling adds and removes workers, and secondary workers, preemptible by default, add processing power without storing data. With the serverless option, you submit a PySpark or Spark SQL batch, and pay only while it runs, with no cluster at all. Choose Spark for existing Spark and Hadoop code, and Dataflow for new pipelines, especially streaming ones.
Visual pipelines
Cloud Data Fusion builds pipelines visually, with no code. It offers plugins for sources, transformations, and sinks, and more in its Hub. It runs the pipelines for you, with no servers to manage. Use it when teams who do not write code must connect many applications and databases.
Loading and ELT in BigQuery
Data acquisition often starts with files. Load jobs bring Avro, Parquet, ORC, CSV, or JSON files into BigQuery, and the Storage Write API streams rows in as they arrive. External tables query files in Cloud Storage where they are, and federated queries reach databases like Cloud SQL or Spanner, without copying anything. Then ELT transforms the data with SQL inside BigQuery: Dataform manages those SQL workflows with dependencies and tests, and scheduled queries run simple ones. Continuous queries run SQL on new rows as they arrive, and write the results to BigQuery, Pub/Sub, Bigtable, or Spanner. For a new source, check its format, how it can be reached, and whether a ready-made connector exists, before writing any code.
AI enrichment
Enrichment adds related data to each event. In Dataflow, the Apache Beam enrichment transform looks up reference data by key, in Bigtable or BigQuery, and RunInference calls a machine learning model inside the pipeline, in batch or streaming. In BigQuery, AI functions like AI dot generate call Gemini models from SQL: they classify text, detect sentiment, pull fields into a structured output, or create embeddings. So support can tag every rider comment with its topic and sentiment in a single query, and keep the results as new columns. Test the prompt on a sample first, and watch cost and quotas, because every row is a model call.
Recap
Let's recap. Managed Service for Apache Spark runs existing Spark and Hadoop jobs, on ephemeral or autoscaled clusters, or as serverless batches. Cloud Data Fusion builds pipelines visually, with plugins, for teams who do not write code. Load jobs, the Storage Write API, external tables, and federated queries bring data to BigQuery, and Dataform or scheduled queries transform it with SQL. Continuous queries process new rows as they arrive. And for enrichment, use the Beam enrichment transform and RunInference in Dataflow, or AI functions in BigQuery.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Five hundred Spark jobs from the North American unit must move to Google Cloud quickly, with as few code changes as possible. Which service fits?
- Dataflow, after rewriting the jobs in Beam
- Managed Service for Apache Spark
- Cloud Data Fusion, rebuilt visually
- BigQuery scheduled queries
Show the answer
Managed Service for Apache Spark
Managed Service for Apache Spark runs existing Spark jobs with few or no changes. “Dataflow, after rewriting the jobs in Beam” would mean rewriting five hundred jobs. “Cloud Data Fusion, rebuilt visually” would rebuild every job by hand in a visual tool. And “BigQuery scheduled queries” would need every job translated into SQL.
New trip rows land in a BigQuery table every minute. Operations wants a Pub/Sub message, within seconds, for each trip that runs far longer than its estimate, using SQL only. What should the data engineer use?
- A continuous query that exports to Pub/Sub
- A scheduled query that runs every hour
- A Dataform workflow run each night
- An external table over Cloud Storage
Show the answer
A continuous query that exports to Pub/Sub
A continuous query runs on new rows as they arrive, and can export its results to Pub/Sub within seconds. “A scheduled query that runs every hour” would run only once an hour. “A Dataform workflow run each night” would run only once a night. And “An external table over Cloud Storage” only reads files where they are, and sends no message.
Support wants every rider comment in BigQuery labeled with a topic and a sentiment, using SQL, without moving the data or training a model. What should the data engineer use?
- Export the comments and label them by hand
- Train a classification model on labeled comments
- An AI function calling a Gemini model
- A Beam enrichment lookup in Bigtable
Show the answer
An AI function calling a Gemini model
AI functions call a Gemini model from SQL, and return the topic and the sentiment as new columns. “Export the comments and label them by hand” would move the data, and take far too long. “Train a classification model on labeled comments” needs labeled data and training, which the team wants to avoid. And “A Beam enrichment lookup in Bigtable” only looks up existing values by key, and cannot read a comment.