Creating a Dataset Using Amazon Athena Data - Amazon QuickSight

Creating a Dataset Using Amazon Athena Data

You can connect to Amazon Athena data sources and use Athena data to create Amazon QuickSight datasets.

Before you try to read files from Amazon S3 buckets, make sure that you grant Amazon QuickSight access to them. For more information, see Using Other AWS Services: Scoping Down Access.

For information about simplifying permissions by using AWS Lake Formation, see Authorizing Connections Through AWS Lake Formation.

For information on using Athena to query Presto, see the Getting Started Writing a Presto Query with Athena in the Amazon Athena User Guide.

Creating a Dataset Using Amazon Athena Data

Use the following procedure to create a new dataset from an existing connection to Athena. Your access to the Athena data source can go through IAM or through AWS Lake Formation, depending on how the permissions are configured by your administrators.

To create a dataset from an existing Athena connection profile

  1. On the Amazon QuickSight start page, choose Manage data.

  2. On the Your Data Sets page, choose New data set.

    The Create a Data Set page displays.

  3. Scroll down to the FROM EXISTING DATA SOURCES section, and choose the connection profile icon for the existing data source you want to use.

    Connection profiles are labeled with the data source icon and the name provided by the person who created the connection.

  4. Choose Create data set to proceed.

    Amazon QuickSight creates a connection profile for this data source based only on the Athena workgroup. The database and table aren't saved.

  5. On the Choose your table screen, do one of the following:

    • To write a SQL query, choose Use custom SQL.

    • To choose a database and table, choose your database for Database. Then choose a table from the list that appears for your database.

Use the following procedure to create a new connection to Athena. Your access to the Athena data source can go through IAM or through AWS Lake Formation, depending on how the permissions are configured by your administrators. For information about simplifying permissions by using AWS Lake Formation, see Authorizing Connections Through AWS Lake Formation.

To create a new connection to Athena

  1. Check Data Source Quotas to make sure that your target table or query doesn't exceed data source quotas.

  2. On the Amazon QuickSight start page, choose Manage data.

  3. On the Your Data Sets page, choose New data set.

  4. In the FROM NEW DATA SOURCES section of the Create a Data Set page, choose the Athena data source icon.

  5. For Data source name, enter a descriptive name for the data source connection. After you do this, this name displays on the connection profile icon under the FROM EXISTING DATA SOURCES section.

  6. On the Choose your table screen, do one of the following:

    • To write a SQL query, choose Use custom SQL. Enter your query, or a placeholder query such as SELECT 1, and choose Confirm SQL.

    • To choose a database and table, choose your database or schema for Database. Then choose a table from the list that appears for your database.

  7. On the Finish data set creation page, choose how you want Amazon QuickSight to handle your data. You can choose either of the following:

    • To load your data into memory with SPICE, choose Import to SPICE for quicker analytics. The green indicator shows whether you have space available.

    • To query your data directly without using SPICE, choose Directly query your data. With this option, you rerun the query each time you open the analysis or dashboard.

  8. Choose from the following options:

    • To prepare the data before creating an analysis, choose Edit/Preview data. This option opens the data preparation screen. When you are finished editing the dataset, choose Save & Visualize to go to your analysis. You can skip the rest of this procedure.

    • To apply an Amazon SageMaker model to your data, choose Augment with SageMaker.

  9. To create a dataset and analyze the data using the table, choose Visualize.