[HTML payload içeriği buraya]
29.1 C
Jakarta
Tuesday, May 12, 2026

Writer information integration jobs with an interactive information preparation expertise with AWS Glue visible ETL


We’re excited to announce a brand new functionality of the AWS Glue Studio visible editor that gives a brand new visible consumer expertise. Now you possibly can writer information preparation transformations and edit them with the AWS Glue Studio visible editor. The AWS Glue Studio visible editor is a graphical interface that allows you to create, run, and monitor information integration jobs in AWS Glue.

The brand new information preparation interface in AWS Glue Studio offers an intuitive, spreadsheet-style view for interactively working with tabular information. Inside this interface, you possibly can visually examine tabular information samples, validate recipe steps by real-time runs, and writer information preparation recipes with out writing code. Throughout the new expertise, you possibly can select from lots of of prebuilt transformations. This permits information analysts and information scientists to quickly assemble the mandatory information preparation steps to satisfy their enterprise wants. After you full authoring the recipes, AWS Glue Studio will routinely generate the Python script to run the recipe information transformations as a part of AWS Glue extract, rework, and cargo (ETL) jobs.

On this put up, we present learn how to use this new function to construct a visible ETL job that preprocesses information to satisfy the enterprise wants for an instance use case, totally inside the AWS Glue Studio console, with out the overhead of handbook script coding.

Instance use case

A fictional e-commerce firm sells attire and permits clients to depart textual content opinions and star rankings for every product, to assist different clients to make knowledgeable buy choices. To simulate this, we are going to use a pattern artificial evaluation dataset, which incorporates totally different merchandise and buyer opinions.

On this situation, you’re an information analyst on this firm. Your position entails preprocessing uncooked buyer evaluation information to arrange it for downstream analytics. This requires remodeling the info by normalizing columns by actions equivalent to casting columns to applicable information sorts, splitting a single column into a number of new columns, and including computed columns based mostly on different columns. To shortly create an ETL job for these enterprise necessities, you employ AWS Glue Studio to examine the info and writer information preparation recipes.

The AWS Glue job will likely be configured to output the file to Amazon Easy Storage Service (Amazon S3) in a most well-liked format and routinely create a desk within the AWS Glue Information Catalog. This Information Catalog desk will likely be shared together with your analyst workforce, permitting them to question the desk utilizing Amazon Athena.

Stipulations

For this tutorial, you want an S3 bucket to retailer output from the AWS Glue ETL job and Athena queries, and a Information Catalog database to create new tables. You additionally must create AWS Id and Entry Administration (IAM) roles for the AWS Glue job and AWS Administration Console consumer.

Create an S3 bucket to retailer output from the AWS Glue ETL jobs and Athena question outcomes

You possibly can both create a brand new S3 bucket or use an present bucket to retailer output from the AWS Glue ETL job and Athena queries. Within the following steps, exchange <glue-etl-output-s3-bucket> and <athena-query-output-s3-bucket> with the identify of the S3 bucket.

Create a Information Catalog database

You possibly can both create a brand new Information Catalog database or use an present database to create tables. Within the following steps, exchange <your_database> with the identify of your database.

Create an IAM position for the AWS Glue job

Full the next steps to create an IAM position for the AWS Glue job:

  1. On the IAM console, within the navigation pane, select Position.
  2. Select Create position.
  3. For Trusted entity sort, select AWS service.
  4. For Service or use case, select Glue.
  5. Select Subsequent.
  6. For Add permissions, select AWSGlueServiceRole, then select Subsequent.
  7. For Position identify, enter a job identify (for this put up, GlueJobRole-recipe-demo).
  8. Select Create position.
  9. Select the created IAM position.
  10. Underneath Permissions insurance policies, select Add permission and Create inline coverage.
  11. For Coverage editor, select JSON, and enter the next coverage:
    {
        "Model": "2012-10-17",
        "Assertion": [
            {
                "Effect": "Allow",
                "Action": [
                    "s3:GetObject",
                    "s3:PutObject",
                    "s3:DeleteObject"
                ],
                "Useful resource": [
                    "arn:aws:s3:::aws-bigdata-blog/generated_synthetic_reviews/*"
                ]
            },
            {
                "Impact": "Permit",
                "Motion": [
                    "s3:List*",
                    "s3:GetObject",
                    "s3:PutObject",
                    "s3:DeleteObject"
                ],
                "Useful resource": [
                    "arn:aws:s3:::<glue-etl-output-s3-bucket>/*",
                    "arn:aws:s3:::<glue-etl-output-s3-bucket>"
                ]
            }
        ]
    }

  12. Select Subsequent.
  13. For Coverage identify, enter a reputation on your coverage.
  14. Select Create coverage.

Create an IAM position for the console consumer

Full the next steps to create the IAM position to work together with the console:

  1. On the IAM console, within the navigation pane, select Position.
  2. Select Create position.
  3. For Trusted entity sort, select the entity of your selection.
  4. For Add permissions, add the next AWS managed insurance policies:
    1. AmazonAthenaFullAccess
    2. AWSGlueConsoleFullAccess
  5. Select Subsequent.
  6. For Position identify, enter a job identify of your selection.
  7. Select Create position.
  8. Select the created IAM position.
  9. Underneath Permissions insurance policies, select Add permission and Create inline coverage.
  10. For Coverage editor, select JSON, and enter the next coverage:
    {
        "Model": "2012-10-17",
        "Assertion": [
            {
                "Sid": "Statement1",
                "Effect": "Allow",
                "Action": [
                    "iam:PassRole"
                ],
                "Useful resource": [
                    "arn:aws:iam::<account-id>:role/GlueJobRole-recipe-demo"
                ]
            },
            {
                "Impact": "Permit",
                "Motion": [
                    "s3:GetObject"
                ],
                "Useful resource": [
                    "arn:aws:s3:::aws-bigdata-blog/generated_synthetic_reviews/*"
                ]
            },
            {
                "Impact": "Permit",
                "Motion": [
                    "s3:List*",
                    "s3:GetObject",
                    "s3:PutObject",
                    "s3:DeleteObject"
                ],
                "Useful resource": [
                    "arn:aws:s3:::<glue-etl-output-s3-bucket>/*",
                    "arn:aws:s3:::<athena-query-output-s3-bucket>/*"
                ]
            }
        ]
    }

  11. Select Subsequent.
  12. For Coverage identify, enter a reputation on your coverage.
  13. Select Create coverage.

The S3 bucket and IAM roles required for this tutorial have been created and configured. Swap to the console consumer position that you simply arrange and proceed with the steps within the following sections.

Writer and run an information integration job utilizing the interactive information preparation expertise

Let’s create an AWS Glue ETL job in AWS Glue Studio. On this ETL job, we load S3 Parquet recordsdata because the supply, course of the info utilizing recipe steps, and write the output to Amazon S3 as Parquet. You possibly can configure all these steps within the visible editor in AWS Glue Studio. We use the brand new information preparation authoring capabilities to create recipes that meet our particular enterprise wants for information transformations. This train will reveal how one can develop information preparation recipes in AWS Glue Studio which might be tailor-made to your use case and may be readily included into scalable ETL jobs. Full the next steps:

  1. On the AWS Glue Studio console, select Visible ETL within the navigation pane.
  2. Underneath Create job, select Visible ETL.
  3. On the high of the job, exchange “Untitled job” with a reputation of your selection.
  4. On the Job Particulars tab, underneath Primary properties, specify the IAM position that the job will use (GlueJobRole-recipe-demo).
  5. Select Save.
  6. On the Visible tab, select the plus signal to open the Add nodes menu. Seek for s3 and add an Amazon S3 as a Supply.
  1. For S3 supply sort, select S3 location.
  2. For S3 URL, specify s3://aws-bigdata-blog/generated_synthetic_reviews/information/product_category=Attire/.
  3. For Information format, choose Parquet.
  4. As a toddler of this supply, search within the Add nodes menu for recipe and add the Information Preparation Recipe
  5. Within the Information preview window, select Begin session if it has not been began.
    1. If it hasn’t been began, Begin an information preview session will likely be displayed on the Information Preparation Recipe
    2. Select your IAM position for the AWS Glue job.
    3. Select Begin session.
  1. After your information preview session has been began, on the Information Preparation Recipe rework, select Writer Recipe to open the info preparation recipe editor.

This may initialize a session utilizing a subset of the info. After session initialization, the AWS Glue Studio console offers an interactive interface that permits intuitive building of recipe steps for AWS Glue ETL jobs.

As described in our instance use case, you’re authoring recipes to preprocess buyer evaluation information for evaluation. Upon reviewing the spreadsheet-style information preview, you discover the product_title column incorporates values like enterprise formal pants, plain and enterprise formal denims, patterned, with the product identify and sub-attribute separated by a comma. To raised construction this information for downstream evaluation, you resolve to separate the product_title column on the comma delimiter to create separate columns for the product identify and sub-attribute. This may enable for simpler filtering and aggregation by product sort or attribute throughout evaluation.

On the spreadsheet-style UI, you possibly can examine the statistics of every column like Min, Median, Max, cardinality, and worth distribution for a subset of the info. This offers helpful insights in regards to the information to tell transformation choices. When reviewing the statistics for the review_year columns, you discover they include a variety of values spanning over 15 years. To allow simpler evaluation of seasonal and weekly developments, you resolve to derive new columns displaying the week quantity and day of the week computed from the review_date column.

Furthermore, for comfort of downstream evaluation, you determined to vary the info sort of the customer_id and product_id columns from string to integer. Changing information sorts is a standard activity in ETL workflows for analytics. The info preparation recipes in AWS Glue Studio present all kinds of widespread ETL transformations like renaming columns, deleting columns, sorting, and reordering columns. Be at liberty to browse the info preparation UI to find different accessible recipes that may assist rework your information.

Let’s see learn how to implement the recipe step within the Information Preparation Recipe rework to satisfy these necessities.

  1. Choose the customer_id column and select the Change sort recipe step.
    1. For Change sort to, select integer.
    2. Select Apply so as to add the recipe step.
  1. Choose the product_id column and select the Change sort recipe step.
    1. For Change sort to, select integer.
    2. Select Apply.
  2. Choose the product_title column and select On a single delimiter underneath SPLIT.
    1. For Delimiter, choose Enter customized worth and enter ,.
    2. Select Apply.
  1. Choose the review_date column and select Week quantity underneath EXTRACT.
    1. For Vacation spot column, enter review_date_week_number.
    2. Select Apply.
  1. Choose the review_date column and select Day of week underneath EXTRACT.
    1. For Vacation spot column, enter review_date_week_day.
    2. Select Apply.

After these recipe steps had been utilized, you possibly can see the customer_id and product_id columns have been transformed to integer, the product_title column has been break up into product_title1 and product_title2, and review_date_week_number and review_date_week_day have been added. Whereas authoring information preparation recipe steps, you possibly can view tabular information and examine whether or not the recipe steps are working as anticipated. This allows interactive validation of recipe steps by the subset examination outcomes previewed within the UI in the course of the recipe authoring course of.

  1. Select Executed authoring recipe to shut the interface.

Now, on the Script tab in AWS Glue Studio console, you possibly can see the script generated from the recipe steps. AWS Glue Studio routinely converts the recipe steps configured by the UI into the Python code. This lets you construct ETL jobs using the wide selection of transformations accessible in information preparation recipes, with out having to manually code the logic your self.

  1. Select Save to save lots of the job.
  2. On the Visible tab, search within the Add nodes menu for s3 and add an Amazon S3 as a Goal.
    1. For Format, select Parquet.
    2. For Compression Sort, select Snappy.
    3. For S3 Goal Location, choose your output S3 location s3://<glue-etl-output-s3-bucket>/output/.
    4. For Information Catalog replace choices, select Create a desk within the Information Catalog and on subsequent runs, replace the schema and add new partitions.
    5. For Database, select the database of your selection.
    6. For Desk identify, enter data_preparation_recipe_demo_tbl.
    7. Underneath Partition keys, select Add a partition key, and choose review_year.
  3. Select Save, then select Run to run the job.

Up so far, we’ve created and run the ETL job. When the job has completed operating, a desk named data_preparation_recipe_demo_tbl has been created within the Information Catalog. The desk has the partition column review_year with partitions for the years 2000–2016. Let’s transfer on to the following step and question the desk.

Run queries on the output information with Athena

Now that the AWS Glue ETL job is full, let’s question the reworked output information. As a pattern evaluation, let’s discover the highest three objects that had been reviewed in 2008 throughout all marketplaces and calculate the common star ranking for these objects. Then, for the highest one merchandise that was reviewed in 2008, we discover the highest 5 sub-attributes for it. This may reveal querying the brand new processed dataset to derive insights.

  1. On the Athena console, run the next question in opposition to the desk:
    SELECT rely(*) AS rely, product_title_1, avg(star_rating) AS ave 
    FROM <your_database>.data_preparation_recipe_demo_tbl 
    WHERE review_year = 2008
    GROUP BY product_title_1
    ORDER BY rely DESC
    LIMIT 3;

This question counts the variety of opinions in 2008 for every product_title_1 and returns the highest three most reviewed objects. It additionally calculates the common star_rating for every of the highest three objects. The question will return outcomes as proven within the following screenshot.

The merchandise made with pure supplies heels is the highest one most reviewed merchandise. Now let’s question the highest 5 most reviewed attributes for it.

  1. Run the next question in opposition to the desk:
    SELECT rely(*) AS rely, product_title_2, avg(star_rating) AS ave 
    FROM <your_database>.data_preparation_recipe_demo_tbl
    WHERE review_year = 2008 
    AND product_title_1 = 'made with pure supplies heels'
    GROUP BY product_title_2
    ORDER BY rely DESC
    LIMIT 5;

The question will return outcomes as proven within the following screenshot.

The question outcomes present that for the highest reviewed merchandise made with pure supplies heels, the highest 5 most reviewed sub-attributes in 2008 had been draped, uneven, muted, polka-dotted, and outsized. Of those high 5 sub-attributes, draped had the very best common star ranking.

By way of this walkthrough, we had been in a position to shortly construct an ETL job and generate datasets that fulfill analytics wants, with out the overhead of handbook script coding.

Clear up

Should you now not want this resolution, you possibly can delete the next sources created on this tutorial:

  • S3 bucket (s3://<glue-etl-output-s3-bucket>, s3://<athena-query-output-s3-bucket>)
  • IAM roles for the AWS Glue job (GlueJobRole-recipe-demo) and the console consumer
  • AWS Glue ETL job
  • Information Catalog database (<your_database>) and desk (data_preparation_recipe_demo_tbl)

Conclusion

On this put up, we launched the brand new AWS Glue information preparation authoring expertise, which helps you to create new low-code no-code information integration recipe transformations immediately on the AWS Glue Studio console. We demonstrated how you should use this function to shortly construct ETL jobs and generate datasets that meet your online business wants with out time-consuming handbook coding.

The AWS Glue information preparation authoring expertise is now publicly accessible. Check out this new functionality and uncover recipes that may facilitate your information transformations.

To be taught extra about utilizing the interactive information preparation authoring expertise in AWS Glue Studio, take a look at the next video and skim the AWS Information Weblog.


In regards to the Authors

Chiho Sugimoto is a Cloud Assist Engineer on the AWS Massive Information Assist workforce. She is obsessed with serving to clients construct information lakes utilizing ETL workloads. She loves planetary science and enjoys finding out the asteroid Ryugu on weekends.

Fabrizio Napolitano is a Principal Specialist Options Architect or Information Analytics at AWS. He has labored within the analytics area for the final 20 years, now specializing in serving to Canadian public sector organizations innovate with information. Fairly without warning, he grow to be a Hockey Dad after transferring to Canada.

Noritaka Sekiyama is a Principal Massive Information Architect on the AWS Glue workforce. He’s accountable for constructing software program artifacts to assist clients. In his spare time, he enjoys biking together with his new highway bike.

Gal HeyneGal Heyne is a Technical Product Supervisor for AWS Information Processing providers with a robust deal with AI/ML, information engineering, and BI. She is obsessed with growing a deep understanding of shoppers’ enterprise wants and collaborating with engineers to design easy-to-use information providers merchandise.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles