Preprocessing BigQuery tabular data for multi-epoch TensorFlow training
Short answer
C Run TFX Transform on Dataflow to encode the SKU text and MaxMin-scale the numerical features once, export TFRecords to Cloud Storage, then feed them into Vertex AI Training.
Question
Key Takeaways
The question tests where full-pass stateful preprocessing should run; the trap is doing it inside BigQuery or on every epoch inside Vertex AI Training, which multiplies scan cost across epochs.
For hundreds of millions of BigQuery rows trained over multiple epochs, use TFX Transform on Dataflow to apply MaxMin scaling and one-hot encoding in one pass, export TFRecords to Cloud Storage, and feed Vertex AI Training (C).
Common mistake: B — scaling in BigQuery and one-hot encoding in TensorFlow looks cheapest, but it re-scans hundreds of BigQuery rows on every epoch instead of preparing data once.
Expert Analysis
Why the most attractive answer falls short
Option B is the answer most candidates reach for, and it satisfies two things at once: BigQuery handles the MaxMin scaling of the numerical features, and TensorFlow performs the one-hot encoding of SKU names during training, which keeps the stored dataset narrow. It also looks cheaper than standing up Dataflow. The fatal flaw is where the work runs. The question states the raw data has hundreds of millions of rows and that training runs over multiple epochs — and option B says "Feed the features into Vertex AI Training" directly from BigQuery. That means the transformation is re-executed against the full table on every epoch, and BigQuery must scan hundreds of millions of rows each pass. Cost scales with epoch count, not with a one-time preparation.
The trap in the SQL-first options
Option D is tempting because BigQuery looks like the cheapest place to do everything: one SQL statement, one view, no Dataflow job. But a MaxMin scaler is a full-pass, stateful transformation — it needs the global min and max across the whole table. As the community notes, BigQuery full-pass transformations require auxiliary lookup tables to hold those statistics, and the SQL script grows in complexity. Option D's step 1 (a separate lookup table) is the tell that the scaler cannot be expressed cleanly in SQL alone. Option A compounds this by adding a Hugging Face model deployment into BigQuery for text encoding — needless complexity for a categorical SKU lookup.
What actually wins: option C
TFX's Transform component on Dataflow computes the scaler statistics and the vocabulary in a single distributed pass, applies both transforms once, and writes the result as TFRecords to Cloud Storage. Subsequent epochs then read preprocessed data cheaply, so cost does not multiply with epochs. This is the pattern Google documents for full-pass preprocessing on large tabular data in BigQuery. The correct answer is C.
Official Reference
https://www.tensorflow.org/tfx/guide/transform
This link opens the official vendor documentation in a new tab.
Exam Strategy
On PMLE preprocessing questions, first identify whether a transform is full-pass and stateful (scalers, vocabularies) or row-local. Stateful transforms cannot run cleanly in BigQuery SQL, so reject SQL-only options for scaling. Then check whether the data is read repeatedly — any option that feeds raw BigQuery data straight into Vertex AI Training will re-scan on each epoch, making it wrong when the prompt stresses cost and multiple epochs. Finally, prefer the option that prepares data once and stores it in a cheap, reusable format such as TFRecords.
Frequently Asked Questions
Why can't MaxMin scaling be done directly in BigQuery SQL?
Why not do one-hot encoding in TensorFlow during training?
Does using TFX and Dataflow increase cost for this scenario?
Community Votes
50% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 25 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 25
-
b2aaace 👍 9 Answered C"Full-pass stateful transformations aren't suitable for implementation in BigQuery. If you use BigQuery for full-pass transformations, you need auxiliary tables to store quantities needed by stateful transformations, such as means and variances to scale numerical features. Further, implementation of full-pass transformations using SQL on BigQuery creates increased complexity in the SQL scripts, and creates intricate dependency between training and the scoring SQL scripts." https://www.tensorflow.org/tfx/guide/tft_bestpractices#where_to_do_preprocessing
-
bobjr 👍 6 Answered DGPT says D, Gemini says B, Perplexity says C.... I say D : stay in one tool, BQ, which is cheap and natively scalable. B has a risk of out of memory error.
-
pipefaxaf 👍 4 Answered DOption D minimizes effort and cost by using BigQuery to handle both the scaling and one-hot encoding. BigQuery is efficient for these types of preprocessing tasks, especially when dealing with large datasets. By preparing the data in BigQuery, you avoid the need to export data to other services or use additional resources for preprocessing, such as Dataflow. This approach provides a streamlined workflow by creating a preprocessed view in BigQuery, which can then be directly fed into Vertex AI Training without extra transformation steps. This helps optimize cost and simplicity while handling large tabular data effectively.
-
guilhermebutzke 👍 4 Answered BMy Answer: B 1. Use BigQuery to scale the numerical features.: Simpler and cheaper then use TFX components with Dataflow to scale the numerical features 2. Feed the features into Vertex AI Training. 3. Allow TensorFlow to perform the one-hot text encoding: TensorFlow handles the one-hot text encoding better than BQ.
-
YangG 👍 4 Answered Cmultiple epochs --> need to persist data after preprocessing
Show 20 more comments
-
pikachu007 👍 3 Answered BOption A: Involves creating a separate lookup table and deploying a Hugging Face model in BigQuery, increasing complexity and cost. Option C: While TFX offers robust preprocessing capabilities, it adds overhead for this use case and requires knowledge of Dataflow. Option D: Performing one-hot encoding in BigQuery can be less efficient than TensorFlow's optimized implementation.
-
Ankit267 👍 3only requirement is minmax scaling, not mean or variance. D, why need extra component like Cloud Storage, Vertex AI when it could be done easily in BQ where already the raw data is stored
-
wences 👍 3 Answered DOption D since it says minimize effort and cost following that adding something rather than BQ will increase complexity.
-
fitri001 👍 2 Answered BBigQuery for Preprocessing: BigQuery is a serverless data warehouse optimized for large datasets.expand_more It can handle scaling numerical features using built-in functions like SCALE or QUANTILE_SCALE, reducing the need for complex custom logic or separate lookup tables. TensorFlow for One-Hot Encoding: TensorFlow excels at in-memory processing. One-hot encoding of categorical features, especially text features like SKU names, can be efficiently performed within your TensorFlow model during training. This avoids unnecessary data movement or transformations in BigQuery. Vertex AI Training: By feeding the preprocessed data (scaled numerical features) directly into Vertex AI Training, you leverage its managed infrastructure for training your custom TensorFlow model.
-
thescientist 👍 2 Answered BWith multiple epochs, the data is passed through the model multiple times. If you pre-encoded the categorical features (as in options C and D), you would be storing and repeatedly reading a much larger dataset (due to the one-hot encoding). This significantly increases storage costs and I/O overhead. By performing the one-hot encoding within TensorFlow during training (as in option B), the encoding happens on-the-fly for each batch of data during each epoch.
-
b1a8fae 👍 2 Answered CInclined to choose C over B. By using TFX components with Dataflow, you can perform feature engineering on large-scale tabular data in a distributed and efficient way. You can use the Transform component to apply the MaxMin scaler and the one-hot encoding to the numerical and categorical features, respectively. You can also use the ExampleGen component to read data from BigQuery and the Trainer component to train your TensorFlow model.
-
AzureDP900 👍 2Option C uses TFX (TensorFlow Extended) components with Dataflow, which is a great way to perform complex data preprocessing tasks like one-hot encoding and scaling. This approach allows you to process your data in a scalable and efficient manner, using Cloud Storage as the output location. By exporting the results as TFRecords, you can easily feed this preprocessed data into Vertex AI Training for model development.
-
daidai75 👍 2 Answered Ckey messages: "contains hundreds of millions of rows, and includes both categorical and numerical features. You need to use a MaxMin scaler on some numerical features, and apply a one-hot encoding to some categorical features such as SKU names". Option B is not suitable for the big volume of data processing. Option C is better.
-
Prakzz 👍 2Isn't Dataflow includes a lot of effort as the question asking to minimize the effort here?
-
gscharly 👍 2 Answered Cagree with daidai75
-
taylz876 👍 1 Answered CWhy C is right, one piece at a time • Prepare the data once, not every epoch. Training reads the data many times. If it comes straight from BigQuery, you pay to scan hundreds of millions of rows on every epoch. Preparing it once and saving it means the later epochs are cheap. • TFX Transform with Dataflow does the heavy preparation in one pass. The Min-Max scaler needs the smallest and largest value across all rows. One-hot encoding SKU names needs a list of all the SKUs. These are "full-pass" jobs that need the whole dataset. Dataflow runs them in parallel across many machines, and TFX Transform is built for exactly this. • TFRecords in Cloud Storage feed training fast. TFRecords are a compact binary format that TensorFlow streams quickly, so the training machines aren't kept waiting for data. • The same preprocessing goes into the model. TFX Transform stores the scaling and encoding logic as part of the TensorFlow graph, so the same steps run when the model serves predictions. That avoids training-serving skew. Why the others are wrong • A: Deploying a Hugging Face model in BigQuery just to encode SKU names is far too complex, and it's the wrong tool for the job. • B: It scales in BigQuery but leaves the data in BigQuery, so every epoch re-reads and re-scans the huge table. The scaling also isn't part of the TensorFlow model, which risks skew at serving time. • D: One-hot encoding in BigQuery creates thousands of mostly empty columns, which inflates storage and cost. It has the same repeated-scan problem on every epoch.
-
fitri001 👍 1Option A: Creates unnecessary complexity and data movement. BigQuery is better suited for scaling numerical features, and TensorFlow is efficient for one-hot encoding. Option C: TFX is a powerful framework for complex pipelines, but for a simpler scenario like this, it might be an overkill. Additionally, exporting data as TFRecords adds an extra step, potentially increasing cost and complexity. Option D: One-hot encoding in BigQuery might be cumbersome for textual features like SKU names. pen_spark exclamation It can be computationally expensive and result in data explosion. TensorFlow handles this efficiently within the model.
-
dija123 👍 1Preprocessing the data once and saving it as TFRecords is highly cost-effective. TFRecord is a binary format optimized for TensorFlow. Training from TFRecords in Cloud Storage is much faster and cheaper than re-scanning a massive BigQuery table for every training epoch.
-
Ankit267 👍 1 Answered DB & D as top 2 choices, C is including Dataflow unnecessarily. D as "minimize the effort and cost of your solution", still some room for B but I selected D
-
pinimichele01 👍 1Option B is not suitable for the big volume of data processing????? BQ is not suitable for big volume??.. for me is B
-
8c200dd 👍 1 Answered DBecause key requirement is minimal effort and cost.
-
DaleR 👍 1Agree with pipefaxal. Minimize effort is key here.
-
dija123 👍 1 Answered Cagree with TFX components with Dataflow
-
dija123 👍 1 Answered CGemini 2.5 Pro is saying C
-
cruise93 👍 1 Answered CAgree with b1a8fae
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →