SAA-C03 ยท Data ingestion, lakes and analytics
Amazon Athena and Amazon Quick Sight
Serverless SQL on S3 with Athena, partitioning to cut scanned data, and building dashboards with the AWS business intelligence service.
Key points
- Athena: serverless SQL on S3 files, tables from the Glue Data Catalog.
- On-demand billing by data scanned: partitions (filter in WHERE), columnar formats, compression cut time and cost.
- New partitions: MSCK REPAIR TABLE (Hive-style), ALTER TABLE ADD PARTITION (other layouts), or partition projection.
- Dashboards: Amazon Quick Sight (formerly QuickSight) connects to Athena, imports data into the SPICE in-memory engine.
Source: https://docs.aws.amazon.com/athena/latest/ug/partitions.html
Practice questions
What drives the charge for an on-demand Amazon Athena SQL query?
- The number of rows the query returns
- The hours a query cluster stays running
- The amount of data the query scans
- The number of tables in the Data Catalog
Show answer
Answer: C. The amount of data the query scans
Athena on-demand queries are billed per amount of data scanned, with a 10 MB minimum per query. There are no instances or query hours to pay for, which is why scanning less data directly lowers the bill.
Which changes reduce the amount of data Athena scans, and so the cost of queries?
- Filter on the partition column in the WHERE clause
- Send the query from a larger EC2 instance
- Store the data as Parquet and select only needed columns
- Compress the data files, for example with gzip
- Spread the same queries across several workgroups
Show answer
Answer: A. Filter on the partition column in the WHERE clause, C. Store the data as Parquet and select only needed columns, D. Compress the data files, for example with gzip
Filtering on a partition column makes Athena read only that partition; columnar Parquet lets it read only the selected columns; compression shrinks the bytes read. Athena is serverless, so the client machine size does not matter, and spreading queries across workgroups changes cost tracking, not bytes scanned.
Athena does not charge for queries that fail, so a failing query over a large table costs nothing.
Show answer
Answer: False
False. Athena bills data scanned for both successful and unsuccessful queries, so a query that fails after scanning a lot of data still costs money.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
