Test database

We proceed to create an S3 bucket to store the query results.

  1. Access S3
  • Select General purpose buckets
  • Select Create bucket

Prerequisite

  1. In the Create bucket interface
  • Bucket namespace select Account Regional namespace (recommended)
  • Bucket name, enter cost-and-usage-query-results

Prerequisite

  1. Select Create bucket

Prerequisite

  1. Create a folder to store query data
  • Select Create folder

Prerequisite

  1. Create folder
  • Folder name, enter Athena-Query-Results
  • Select Create folder

Prerequisite

  1. Complete creating folder

Prerequisite

  1. Access AWS Management Console
  • Search Athena
  • Select Athena

Prerequisite

  1. To interact with the data table, we need to configure the location to save the query results on S3.
  • Select Query editor
  • Select Query settings

Prerequisite

  1. Select Manage

Prerequisite

  1. Select the S3 path to store

Prerequisite

  1. Then, select Editor

Prerequisite

  1. Recheck and perform the query
  • Data Source, select AwsDataCatalog
  • Database, select costmaster
  • Table, select monthly_report
  • Perform the query with the following command: the table data is saved into Amazon Athena’s metastore.
MSCK REPAIR TABLE monthly_report;
  • Select Run
  • Complete the query Query successful

Prerequisite

  1. Preview the system to check the ability to query data tables on AWS Glue
  • Select monthly_report table
  • Select Preview Table
SELECT * FROM "costmaster"."monthly_report"
LIMIT 10;

Prerequisite