Over a million developers have joined DZone.

Amazon Athena and Tableau: Serverless Interactive Query Service and BI

DZone's Guide to

Amazon Athena and Tableau: Serverless Interactive Query Service and BI

Learn how Athena can process both structured and semi-structured data in different file formats, generate reports in connection with BI tools, and more.

· Big Data Zone ·
Free Resource

Cloudera Data Flow, the answer to all your real-time streaming data problems. Manage your data from edge to enterprise with a no-code approach to developing sophisticated streaming applications easily. Learn more today.

Amazon Athena, a serverless query service in Amazon Simple Storage Service (S3) and a pay-per service, is used to easily analyze data using standard SQL in S3. It has a very high query performance, even for huge datasets and complex queries.

Athena can process both structured and semi-structured data in different file formats such as CSV, JSON, Parquet, and ORC. It can be used to generate reports in connection with BI tools. It uses Hive for creating database and tables. As it has metastore, it can be used with Hadoop, Spark, and Presto.


Sign into AWS console. Then, create your own S3 bucket in S3 to upload data as shown below:



Lastly, create a database and tables in Athena to query the data.


Dataset Description

A sample dataset, containing bank transaction data of a customer, is used in this use case. For sample dataset, scroll down to the References section.


  • Step: Maps a unit of time in the real world; in this use case, one step represents one hour of time.
  • Type: Diverse types of payments (i.e. CASH_IN, CASH_OUT, DEBIT, PAYMENT, and TRANSFER).
  • Amount: Amount of transaction in local currency.
  • nameOrig: Customer who started the transaction.
  • oldbalanceOrg: Initial balance before the transaction.
  • newbalanceOrig: New balance after the transaction.
  • NameDest: Customer who is the recipient of the transaction.
  • OldbalanceDest: Initial balance recipient before the transaction.
  • NewbalanceDest: New balance recipient after the transaction.
  • IsFraud: Transactions made by the fraudulent agents inside the simulation.
  • IsFlaggedFraud: An illegal attempt in this dataset is an attempt to transfer more than 200,000 units in a single transaction.

Note: There is no information for customers name starting with M (Merchants).

Use Cases

Data security plays a significant role in almost all sectors, but especially in financial institutions such as banks, credit unions, and so on. As mobile transactions in the financial industry have increased in recent years, it is highly challenging to secure the data in the mobile platform. In this use case, let's discuss finding and managing malicious behavior during mobile transactions.

In this blog, let's discuss the below use cases:

  • Connect Athena with JDBC SQL Workbench Driver.
  • Connect Athena with BI Tools (Tableau 10.3).

Connecting Athena With JDBC SQL Workbench Driver

You can query data from AWS console by connecting JDBC SQL workbench with Athena.


To connect Athena with JDBC driver using SQL workbench, perform the following:

  • In SQL workbench, choose File > Manage drivers.
  • Perform the configuration shown in the below diagram:select
  • Add a new driver connection by configuring user name and password as your AWS access key and secret key, respectively.
  • Configure your s3_staging_dir in Extended Properties to save your executed queries in your S3 bucket.


  • Create a table with SQL Workbench.


The table structure is as follows:


The data visualization in table format is as follows:

selectThe data is queried as follows:


Connecting Athena With BI Tools (Tableau 10.3)

To connect Athena with Tableau, perform the following:

  • Download Athena connector from this path.
  • Place the connector in the C:\Program Files\Tableau\Drivers directory.
  • In Tableau, configure the following:
    • Server: atena.region.com
    • Port: 443
    • S3 Staging Directory: s3://yourbucketname/query_save_folder
    • Access Key ID
    • Secret Access Key


Upon successfully creating connections, Athena databases will be listed out as shown in the below diagram:


Data Visualization

A few data visualizations are as follows:

Total amount based on type and IsFraud flag:


New balance and old balance based on type:


Total amount based on type and fraudulent activities:


Minimum new balance and minimum old balance based on type:


Count of steps for fraudulent types of transactions:


Percentage of steps for fraudulent type of activities:



 Cloudera Enterprise Data Hub. One platform, many applications. Start today.

athena ,tableau ,business inteligence ,big data ,tutorial ,data analytics ,data visualization ,amazon s3 ,serverless

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}