QA
Intermediate LevelCloud Computing (AWS/GCP/Azure)

What is Amazon Athena and how does it run serverless SQL queries over S3 data lakes?

❓ Interview Prompt: Explain Amazon Athena Presto/Trino query engine, querying S3 objects in-place, Parquet compression, and partition pruning.

Amazon Athena is an interactive serverless query service that makes it easy to analyze data directly in Amazon S3 using standard ANSI SQL queries.

Key Concepts:

1
Query Engine: Built on open-source Presto / Trino engines.
2
Serverless: No database clusters or data loading required. Pay strictly per TB of data scanned ($5.00/TB scanned).
3
Cost & Performance Optimizations:
•
Columnar Formatting: Convert raw JSON/CSV data into Apache Parquet or ORC columnar formats (scans 90% less data!).
•
Partition Pruning: Structure S3 object keys into partitions ('s3://bucket/year=2026/month=07/') to scan only relevant data folders.

Code Implementation Example

sql
-- Partitioned Athena SQL query over Parquet S3 data lake
CREATE EXTERNAL TABLE IF NOT EXISTS access_logs (
  user_id STRING,
  action STRING,
  ip STRING
)
PARTITIONED BY (year STRING, month STRING)
STORED AS PARQUET
LOCATION 's3://company-data-lake/logs/';

-- Query scans ONLY July 2026 partition data!
SELECT user_id, COUNT(*) FROM access_logs WHERE year = '2026' AND month = '07' GROUP BY user_id;
💡Athena DDL creating partitioned Parquet table over S3 data lake.
🎯 Interview Key Takeaway

Athena runs serverless ANSI SQL queries directly over S3 objects; use Parquet columnar formatting to cut query costs by 90%.

#Athena#SQL#S3 Data Lake#Parquet#Intermediate
Back to all Cloud Computing (AWS/GCP/Azure) Questions→

More Cloud Computing (AWS/GCP/Azure) Interview Questions

Beginner LevelCloud Computing (AWS/GCP/Azure)

How does Serverless Architecture (AWS Lambda / GCP Cloud Run) handle Auto-Scaling and Cold Starts?

Beginner LevelCloud Computing (AWS/GCP/Azure)

What is the difference between IaaS, PaaS, and SaaS cloud service models?

Beginner LevelCloud Computing (AWS/GCP/Azure)

What is AWS EC2 and what are On-Demand, Reserved, and Spot Instance pricing models?