Building Serverless Batch Pipelines with BigQuery SQL
Short answer
C Ingest your data into BigQuery from Cloud Storage, convert your PySpark commands into BigQuery SQL queries to transform the data, and then write the transformations to a new table.
Question
are taking over twelve hours to run. To expedite development and pipeline run time, you want to use a serverless tool and SOL syntax. You have already moved
your raw data into Cloud Storage. How should you build the pipeline on Google Cloud while meeting speed and processing requirements?
Key Takeaways
The main trap is confusing Dataproc Serverless with BigQuery; while both support SQL, BigQuery is truly serverless and optimized for rapid SQL-based transformations of structured data stored in GCS.
This page explains how to build a serverless batch pipeline on Google Cloud using BigQuery SQL for fast structured data transformations, replacing slow PySpark jobs.
Common mistake: Users often choose Option A (Dataproc) because they focus on the 'Spark SQL' aspect and overlook the strict 'serverless' requirement and performance benefits of BigQuery's MPP engine for simple SQL transformations.
Expert Analysis
The question asks for a serverless solution using SQL syntax to expedite a batch pipeline that currently takes over twelve hours. The key constraints are "serverless tool" and "SQL syntax." While Dataproc is a managed Hadoop/Spark service, it is not fully serverless in the same way BigQuery is; it requires managing clusters (even with autoscaling) or paying for serverless Spark which still runs Spark SQL, not native BigQuery SQL. BigQuery is inherently serverless and uses its own SQL dialect. Therefore, moving data from Cloud Storage directly into BigQuery (ELT pattern) and performing transformations via BigQuery SQL is the most direct path to meeting both the speed and serverless requirements.
Community comments highlight this distinction. Some users initially suggested Dataproc Serverless (Option A), arguing that Spark SQL is sufficient. However, others correctly pointed out that BigQuery SQL is more performant for structured data transformations and strictly adheres to the "serverless" constraint without any cluster overhead. One comment noted that while Dataproc Serverless supports Spark SQL, the question emphasizes "SQL syntax" in the context of speeding up development and run time, where BigQuery's massively parallel processing (MPP) engine excels. Another comment clarified that Option D (Apache Beam) uses Python SDK by default, not SQL, unless specifically configured with Beam SQL, making it less ideal than native BigQuery SQL.
The operational consequence of choosing Dataproc (Option A) is that you are still managing compute resources indirectly and potentially facing longer setup times and higher latency compared to BigQuery's on-demand execution. Getting it wrong means missing the opportunity to leverage BigQuery's optimized storage and compute engine for rapid, scalable SQL-based transformations.
Exam Strategy
When a question specifies 'serverless' and 'SQL', prioritize BigQuery over Dataproc or Dataflow unless there is a specific need for complex logic or non-SQL APIs. Remember that BigQuery is best suited for ELT patterns where data is loaded first and then transformed using SQL. For complex stream processing or custom logic, consider Dataflow, but note that its primary API is Python/Java, not SQL.
Frequently Asked Questions
Why not use Dataproc Serverless for Spark SQL?
Can Apache Beam be used with SQL?
Community Votes
73% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 22 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 22
-
devaid 👍 14 Answered CThe question is C but not because the SQL Syntax, as you can perfectly use SparkSQL on Dataproc reading files from GCS. It's because the "serverless" requirement.
-
TNT87 👍 4 Answered CThis same question is there on Google's Professional Machine Learning Engineer, Question 4 Answer is C.
-
MaxNRG 👍 3 Answered COption C is the best approach to meet the stated requirements. Here's why: BigQuery SQL provides a fast, scalable, and serverless method for transforming structured data, easier to develop than PySpark. Directly ingesting the raw Cloud Storage data into BigQuery avoids needing an intermediate processing cluster like Dataproc. Transforming the data via BigQuery SQL queries will be faster than PySpark, especially since the data is already loaded into BigQuery. Writing the transformed results to a new BigQuery table keeps the original raw data intact and provides a clean output. So migrating to BigQuery SQL for transformations provides a fully managed serverless architecture that can significantly expedite development and reduce pipeline runtime versus PySpark. The ability to avoid clusters and conduct transformations completely within BigQuery is the most efficient approach here.
-
AWSandeep 👍 3Changing answer to A as this is a new question referring to Dataproc Serverless. Dataproc Serverless for Spark batch workloads supports Spark SQL. Why modify ETL to ELT and convert PySpark to BigQuery SQL when it can be similar to a lift-and-shift?
-
AWSandeep 👍 3 Answered CC. Ingest your data into BigQuery from Cloud Storage, convert your PySpark commands into BigQuery SQL queries to transform the data, and then write the transformations to a new table. Keys: "Serverless" and "SQL"
Show 17 more comments
-
Atnafu 👍 3Dataproc is diffrent than Dataproc Serveless. This question is talking about dataproc. By the way dp serverless support both pyspark and sparkSql no need of conversion. C is best answer
-
MoeHaydar 👍 3 Answered CNote: Dataproc by itself is not serverless https://cloud.google.com/dataproc-serverless/docs/overview
-
Prudvi3266 👍 3 Answered Cbecause of serverless nature
-
maci_f 👍 2 Answered AIn the GCP Machine Learning Engineer practice question (Q4) there's the same question with similar answers and the correct answer is A since B "is incorrect, here transformation is done on Cloud SQL, which wouldn’t scale the process" and C "is incorrect as this process wouldn’t scale the data transformation routine. And, it is always better to transform data during ingestion": https://medium.com/@gcpguru/google-google-cloud-professional-machine-learning-engineer-practice-questions-part-1-3ee4a2b3f0a4
-
Wasss123 👍 2 Answered CI choose C BigQuery SQL is more performant but more expensive. Here, it's a performance issue ( time reduction) Source : https://medium.com/paypal-tech/comparing-bigquery-processing-and-spark-dataproc-4c90c10e31ac
-
Atnafu 👍 2A could be answer if it was Dataproc serverless and no conversion of code. Dp serverless support: scala,pyspark,sparksql and SparkR
-
evanfebrianto 👍 2Dataproc is not a serverless tool unless it mentions "Dataproc Serverless" explicitly.
-
GCP001 👍 2 Answered AA) Looks more suitable , serverless approach for handling and performance.
-
TNT87 👍 2Answer C
-
carbonscave 👍 1 Answered CWhy C is correct The ELT Pattern: This is the classic Extract, Load, Transform (ELT) architecture. For structured data, the absolute fastest way to process it on Google Cloud is to load the raw data directly into BigQuery's proprietary storage and let BigQuery's massive compute engine handle the heavy lifting. Jobs that take 12 hours on an on-premises Spark cluster often finish in minutes in BigQuery. Fully Serverless: BigQuery is Google's flagship fully serverless data warehouse. You don't provision nodes, manage clusters, or tune infrastructure. You just run your query. Native SQL: The prompt explicitly states you want to use "SQL syntax" to expedite development. BigQuery uses standard ANSI SQL, allowing your team to easily rewrite those PySpark transformations into clean, highly optimized SQL statements.
-
musumusu 👍 1Answer C: need to setup SQL based job means transformation in not very complex. And Biqquery sql are faster than spark sql context. (google claims) However, i will make a test by myself to check it.
-
John_Pongthorn 👍 1C is the most likely , bigquery is severless and sql D is dataflow severless but it is wrong at using python sdk but using sql beam rthen it will be correct
-
Atnafu 👍 1C D-is incorrect because you are rebuild your batch pipeline for structured data on Google Cloud.
-
ducc 👍 1After thinking a while, I think the question is not clear enough. To be honest
-
ducc 👍 1A or C. I go for C because they said they want to use SQL syntax...
-
ducc 👍 1The question said "use SQL syntax" C might still correct
-
ducc 👍 1 Answered AA - You have to maintain PySpark Code -> Proc
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.