By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Topic: AWS Glue ETL, EMR, SageMaker Data Wrangler, Lambda
Data transformation is the backbone of any ML pipeline—cleaning, enriching, and structuring raw data into features ready for training or inference. In AWS, this means choosing between serverless ETL (Glue), big data processing (EMR), interactive data prep (SageMaker Data Wrangler), or lightweight event-driven transformations (Lambda). Real-world scenario: A fintech company ingests 10M daily transactions from Kafka, needs to deduplicate records, normalize amounts, and join with customer metadata before training a fraud detection model. The wrong tool (e.g., Lambda for 10TB joins) could cost $10K/month in failed jobs or timeouts.
s3://bucket/year=2023/month=01/
Scenario: Clean and aggregate 500GB of raw CSV logs in S3 for a recommendation model.1. Crawl the data: Create a Glue Crawler to scan S3 and populate the Glue Data Catalog (schema + metadata).2. Define the job: Use Glue Studio (visual editor) or Python/Scala scripts to: - Filter null values. - Convert timestamps to UTC. - Join with a DynamoDB table (e.g., user profiles).3. Optimize performance: - Use Glue DynamicFrames (handles schema evolution better than Spark DataFrames). - Enable bookmarks to track processed files (avoid reprocessing). - Set DPUs (Data Processing Units) based on data size (1 DPU = 4 vCPUs, 16GB RAM).4. Schedule the job: Trigger via EventBridge (e.g., "run at 2 AM daily") or Glue Workflows (for multi-step pipelines).5. Output: Write to S3 in Parquet (columnar format for ML) or Redshift (for BI).
Scenario: Join 10TB of clickstream data with user profiles for a personalization model.1. Launch an EMR cluster: - Choose Spark as the framework. - Select instance types (e.g., r5.2xlarge for memory-heavy joins, g4dn.xlarge for GPU-accelerated ML). - Enable auto-scaling to handle variable workloads.2. Submit a Spark job: - Use EMR Notebooks or Step Functions to run PySpark scripts. - Optimize with: - Partitioning (e.g., df.repartition("user_id")). - Broadcast joins for small tables (e.g., user metadata).3. Store results: Write to S3 (for ML) or Redshift (for analytics).4. Terminate the cluster: Use EMR Managed Scaling or auto-termination to avoid idle costs.
r5.2xlarge
g4dn.xlarge
df.repartition("user_id")
Scenario: Clean a dataset for a churn prediction model before training.1. Import data: Connect to S3, Redshift, or Athena (no need to move data).2. Explore & transform: - Use the visual editor to: - Handle missing values (impute or drop). - Encode categorical variables (one-hot or target encoding). - Detect bias (e.g., class imbalance in target variable).3. Export: - To a notebook: Generate a Python script for reproducibility. - To SageMaker Pipelines: Automate the workflow.4. Train: Use the cleaned data in a SageMaker Training Job.
Scenario: Filter and enrich IoT sensor data before storing in DynamoDB.1. Trigger Lambda: Set up an S3 Event Notification (e.g., "run when a new file is uploaded").2. Write the function: - Use boto3 to read the S3 file. - Apply transformations (e.g., convert units, filter outliers). - Write to DynamoDB or Kinesis (for streaming).3. Optimize: - Increase memory (scales CPU proportionally). - Use provisioned concurrency to avoid cold starts.4. Monitor: Check CloudWatch Logs for errors (e.g., timeouts, throttling).
s3://bucket/all_data.csv
Use EMR for complex transformations (e.g., 10TB joins, graph algorithms, custom Spark versions).
Data Wrangler vs. Glue DataBrew:
DataBrew is standalone (BI/analytics-focused).
Lambda for ML?
Not for training/inference (use SageMaker instead).
Feature Store vs. S3:
S3 is for raw/processed data (e.g., training datasets).
Tricky Question Types:
Why: Glue is serverless, scales automatically, and integrates with Redshift.
A data scientist wants to clean a dataset interactively and detect bias before training a model. Which tool should they use?
Why: Data Wrangler provides a GUI for cleaning and bias detection, and integrates with SageMaker.
A company receives 10,000 IoT sensor readings per second. They need to filter outliers and enrich the data with metadata before storing it in DynamoDB. Which service should they use?
year=2023/month=01/
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.