Skip to main content
Welcome back. This guide demonstrates how to use AWS Glue Studio’s Visual ETL to prepare data for machine learning workflows. We’ll change a dataset schema (type casting and column removal) and write the processed CSV back to Amazon S3. AWS Glue, AWS Data Wrangler, and AWS Glue DataBrew each help with data transformation:
  • AWS Glue provides a full managed ETL service (including streaming integration with Amazon Kinesis).
  • AWS Data Wrangler and AWS Glue DataBrew provide interactive, built-in transformations for ad hoc or notebook-based workflows. In this lesson we focus on Glue Studio’s Visual ETL (the graphical job authoring experience).
For this demo we use the Titanic dataset stored in an S3 bucket with the following layout: models, predictions, processed, raw, and training.
The image shows an AWS S3 console with a bucket named "machine-learning-demo-ak," containing folders for models, predictions, processed data, raw data, and training data.
Most raw training data lives in the raw folder. Our goal:
  • Cast a few columns to appropriate types (e.g., convert pclass to integer).
  • Drop an unnecessary column (parents/children).
  • Write the cleaned CSV to the processed folder.
The image shows an Amazon S3 console with a bucket named "machine-learning-demo-ak" containing two objects: a CSV file named "titanic.csv" and a folder with the same name.

Visual ETL (Glue Studio) — Graph-based authoring

Glue Studio uses a graph model: nodes = sources, transformations, targets. For this job we choose Amazon S3 as the source.
The image shows an AWS Glue Studio interface with options to add data sources, such as AWS Glue Data Catalog, Amazon S3, and others.
Steps (high level)
  1. Add an S3 source node and point it to the raw/titanic.csv path; select CSV format.
  2. Choose or create an IAM role that grants Glue read/write access to S3.
  3. Preview the inferred schema and data.
  4. Add a “Change Schema” transformation node to cast types and drop columns.
  5. Add an S3 target node and configure output path (processed/) and CSV settings.
  6. Save and run the job; verify the processed output.
Make sure the IAM role provided to the Glue job has S3 read access to the source and S3 write access to the target path. If you need a starting point, attach a policy that grants s3:GetObject, s3:ListBucket, and s3:PutObject for the relevant prefixes. This avoids runtime failures due to permission errors.
You can preview the dataset and confirm the schema before applying transformations.
The image shows an AWS Glue Studio interface with a dataset preview from an S3 bucket using CSV format. It includes a data table with columns like "survived," "pclass," "name," "sex," and "age."

Apply schema changes

Add a transformation node. Glue Studio supports schema mapping and other transformations; DataBrew recipes are an alternate interactive option. For this example we use the “Change Schema” transformation to:
  • Cast pclass (currently inferred as string) to integer.
  • Drop the parents/children column (not needed for the ML workflow).
The image shows an AWS Glue Studio interface, displaying a visual workflow with a data source from an Amazon S3 bucket and a transformation for schema change. There is a panel on the right for applying schema mappings with source keys, target keys, data types, and drop options.
Transformation summary After adding the schema mappings, add an S3 target node and configure the output format to CSV (no compression) and set the output prefix to the processed folder.
The image shows an AWS Glue Studio interface with a visual job flow. It features connections from an Amazon S3 data source to a transformation node for changing schema and then to a data target, also an S3 bucket, with properties being configured on the right panel.

Run the job and verify output

  • Save and run the job. In this demo the job ran for ~1 minute and 6 seconds and used 10 DPUs.
  • After the job completes, check the S3 processed/ folder for the output CSV file and download it for inspection.
Example excerpt from the processed CSV (note: pclass is now integer and parents/children is removed; names with commas are quoted):
This pattern—source → transformation(s) → target—can be reused for other data sources, schema changes, aggregations, and target formats (Parquet, JSON, etc.).

Quick reference

After testing, remember to delete any temporary files, Glue jobs, and IAM roles you no longer need to avoid unexpected costs.

Watch Video