Transformation services and formats
DEA-C01 · Lesson 3 of 23 · 17:37
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 DEA-C01 exam (AWS Certified Data Engineer – Associate). In this lesson: AWS Glue for serverless ETL, Amazon EMR clusters that you tune, Lambda for small tasks, and SQL transformations in Redshift, JDBC and ODBC drivers and Glue connections, joins on clean keys, lower costs with Glue Flex, auto scaling, and Spot task nodes, containers with ECS, Fargate, EKS, and EMR on EKS, and columnar formats like Parquet and ORC. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
From raw to ready
The raw data of AnyCompany Games is messy: JSON events, CSV ad reports, and tables in Aurora and DynamoDB. Analysts want clean Parquet tables that join purchases to players and to ad campaigns, at the lowest cost. This lesson covers the services that transform data, how they connect to sources, how to join sources, how to cut costs, and how to change formats.
Transformation services
Pick the service from the job. AWS Glue runs serverless Spark jobs, or small Python shell jobs, and you pay only while they run, which suits most ETL. Amazon EMR runs Spark, Hive, Presto, and other open source frameworks on clusters that you size and tune, for very large or long jobs, or for teams that need special libraries. Lambda transforms small files or single records in seconds, like cleaning one JSON file when it lands. And Amazon Redshift transforms data with SQL inside the warehouse, an ELT approach, with stored procedures and materialized views.
Connections and joins
Sources speak different protocols. JDBC, Java Database Connectivity, and ODBC, Open Database Connectivity, are standard drivers that let tools and jobs talk to databases, and Athena and Redshift both offer them for business intelligence tools. In AWS Glue, a connection stores the address, the credentials, and the network settings of a data store, and crawlers and jobs reuse it. To integrate multiple sources, a Glue job reads each one into a frame, then joins them on a shared key, like the player ID in purchases, profiles, and ad clicks. Clean the keys and remove the repeated ones first, because a join on dirty keys silently drops or doubles rows.
Optimizing costs
Cost is part of the design. In Glue, the Flex execution class costs less for non-urgent jobs, such as tests and one-time loads, and auto scaling adds or removes workers as the job needs them. Pick the smallest worker type that fits, and turn on job bookmarks so that each run reads only the new data. On EMR, run the primary and core nodes on demand, and the task nodes on Spot Instances, which cost much less and can be taken back, while managed scaling resizes the cluster. And everywhere, store compressed columnar files, partition them, and filter early, because you pay for what you scan and process.
Containers
Some transformations come as containers, with their own libraries and versions. Amazon ECS runs containers as tasks, and AWS Fargate runs them without servers to manage, which suits a nightly job packaged as an image. Amazon EKS runs Kubernetes, and Amazon EMR on EKS runs Spark jobs on an existing EKS cluster, next to other applications. To fit performance needs, set the CPU and memory of each task or pod from what the job uses, scale the number of tasks or pods with the load, and use Fargate Spot or Spot nodes for jobs that can be interrupted. And keep images small, with only the libraries that the job needs, so containers start faster.
File formats
Formats decide how much data each query reads. CSV and JSON are row formats: easy to write and easy for people to read, but every query reads every column. Apache Parquet and ORC are columnar formats that store and compress each column apart, so a query on three columns reads only those three, while Avro is a row format with a schema, good for streams and for writing record by record. To convert, a Glue job reads the CSV files and writes Parquet, Athena can do it with a create table as select query, and Amazon Data Firehose converts JSON records to Parquet or ORC before they land in S3.
Recap
Let's recap. Glue runs serverless ETL, EMR runs clusters that you tune, Lambda handles small tasks, and Redshift transforms with SQL. JDBC and ODBC drivers and Glue connections reach the sources, and joins need clean keys. Flex, auto scaling, and Spot task nodes cut costs. ECS, Fargate, EKS, and EMR on EKS run containers sized to the job. And Parquet and ORC are columnar formats that cut the data each query reads.
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.
Each night, a job must join 40 GB of game events in S3 with the player table of an Aurora database, then write Parquet files. The team wants no cluster to manage. Which service fits best?
- An Amazon EMR cluster with Spot task nodes
- An AWS Glue Spark job with a JDBC connection
- A Lambda function invoked for each new file
- A materialized view in Amazon Redshift
Show the answer
An AWS Glue Spark job with a JDBC connection
A Glue Spark job is serverless, reads Aurora through a JDBC connection, and joins large data sets. “An Amazon EMR cluster with Spot task nodes” would work, but the team would have to manage a cluster. “A Lambda function invoked for each new file” would hit the limit of 15 minutes, and each function would see only one file. And “A materialized view in Amazon Redshift” would need all the data in Redshift first.
A nightly Glue job rebuilds a test environment. It is not urgent, and it can finish at any time before morning. How can the team cut its cost the most?
- Switch the job to a larger worker type
- Move it to an EMR cluster with on-demand nodes
- Rewrite the job as a single Lambda function
- Run the job with the Flex execution class
Show the answer
Run the job with the Flex execution class
The Flex execution class is meant for non-urgent jobs like tests, and it costs less. “Switch the job to a larger worker type” would raise the price of every hour of the job. “Move it to an EMR cluster with on-demand nodes” would add a cluster to manage, at on-demand prices. And “Rewrite the job as a single Lambda function” is not built for Spark jobs that run for a long time.
Analysts use Athena on two years of ad reports stored as CSV files in S3. Each query reads 3 columns out of 60, and scan costs grow every month. What should the data engineer do?
- Compress the CSV files with gzip
- Split the CSV files into smaller files
- Convert the reports to Parquet with a Glue job
- Load the reports into a DynamoDB table
Show the answer
Convert the reports to Parquet with a Glue job
Parquet stores each column apart, so Athena scans only the three columns that a query uses. “Compress the CSV files with gzip” would shrink the files, but each query would still read all sixty columns. “Split the CSV files into smaller files” would create more small files, and slow the queries down. And “Load the reports into a DynamoDB table” is a key-value store, not a place for SQL scans.