Build database

In the lab, once we have the input data with the path above as at the beginning of the lab, we will configure AWS Glue and Crawler to run on a schedule once a day. Crawler will scan the path containing the input Parquet file, save it on S3, and then create a database along with accompanying tables. When there is a new version of the report, the data table will be automatically updated.

Amazon Athena helps us access and view the contents of the parquet file via SQL commands. Amazon Athena is a serverless solution that supports executing SQL query commands on large amounts of data. Athena is only charged for the data scanned, unlike traditional database solutions.

The detailed configuration steps so that Amazon Athena can access data files via AWS Glue are as follows:

  1. Access AWS Management Console

    • Search AWS Glue
    • Select AWS Glue

Prerequisite

  1. In the AWS Glue interface

    • Select Crawlers
    • Select Create crawler

Prerequisite

  1. Configure Crawler, enter Name as Cost_MasterCrawler. Then, select Next

Prerequisite

  1. Select Add a data source

Prerequisite

  1. Configure data source

Prerequisite

  1. Select S3 path

Prerequisite Prerequisite

  1. Complete the data source configuration.

Prerequisite

  1. After configuring the data source, select Next

Prerequisite

  1. For Configure security settings, you enter the role name AWSGlueServiceRole-MasterCrawler and click Next

Prerequisite

  1. Proceed to add a database
  • Select Add database

Prerequisite

  1. Enter the database name as costmaster. Select Create database

Prerequisite

  1. Complete creating the database.

Prerequisite

  1. Add the database successfully and select Next

Prerequisite

  1. Review and select Create crawler

Prerequisite

  1. Complete creating the crawler.

Prerequisite

  1. Select Run crawler

Prerequisite

  1. It takes about 1 minute to initialize the run crawler.

Prerequisite

  1. Initialize run crawler

Prerequisite

  1. Run crawler successfully.

Prerequisite

  1. Check the Table of AWS Glue. We see the data table monthly_report

Prerequisite

  1. View detailed information of the data table.

Prerequisite