Optimizing Amazon Athena Query Performance with Parquet and Partitioning

DEA-C01 By islever Editorial Last updated

Short answer

D Convert CSV logs to a single Apache Parquet file per day, partition by date, and use predicate pushdown filters for shortest query times.

Question

An ecommerce company collects daily customer transaction logs in CSV format and stores the logs in Amazon S3. The company uses Amazon Athena to scan a subset of attributes from the logs on the same day the company receives each log.
Query times are increasing because of increasing transaction volume. The company wants to improve query performance.
Which solution will meet these requirements with the SHORTEST query times?
  1. Convert the CSV logs into multiple ORC files for better parallelism in Athena. Partition by date in Amazon S3. Use columnar pushdown filters.
  2. Convert the CSV logs to JSON. Partition by date in Amazon S3. Use Athena with dynamic filtering to reduce data scans.
  3. Convert the CSV logs to Avro. Partition by date in Amazon S3. Use Athena with projection-based partitioning.
  4. Convert the CSV logs to a single Apache Parquet file for each day Partition the data by date in Amazon S3. Use Athena with predicate pushdown filters. Correct Answer

Key Takeaways

The main trap is choosing row-based formats (JSON, Avro) or less optimal columnar setups; the key is using Parquet with predicate pushdown to scan only required columns.

Learn how to minimize Amazon Athena query times by converting CSV logs to Apache Parquet, partitioning by date, and leveraging predicate pushdown filters for efficient column scanning.

Common mistake: Choosing Option A (ORC) or Option B (JSON) because users may confuse general database optimization with Athena's specific strengths in columnar storage and partitioning.

Expert Analysis

The core concept tested here is data format optimization for Amazon Athena, specifically the trade-offs between columnar formats and how they interact with query engines. The question asks for the solution with the SHORTEST query times given increasing transaction volumes.

Athena performs best with columnar data formats like Apache Parquet or ORC. These formats allow Athena to use predicate pushdown (also known as column pruning), meaning it only reads the columns needed for the query and skips irrelevant data, significantly reducing I/O and processing time. Among columnar formats, Parquet is widely regarded in AWS contexts as having superior compression ratios and performance characteristics for analytical workloads compared to ORC, especially when dealing with large-scale log data.

Let's evaluate the options:

  • Option A suggests using multiple ORC files. While ORC is a valid columnar format, splitting data into multiple small files can introduce overhead due to metadata management and file open/close operations. Furthermore, Parquet is generally preferred over ORC in modern AWS analytics stacks unless there is a specific Hadoop ecosystem constraint.
  • Option B suggests JSON. JSON is a row-based format. Reading JSON requires parsing the entire record even if only a subset of attributes is needed. This leads to higher I/O and slower query times compared to columnar formats. It does not support efficient predicate pushdown in the same way.
  • Option C suggests Avro. Avro is a row-based format optimized for write-heavy transactions and serialization, not for read-heavy analytical queries. It does not support column pruning effectively, making it unsuitable for improving query performance in Athena.
  • Option D suggests converting to a single Apache Parquet file per day, partitioned by date, and using predicate pushdown. This approach combines the benefits of a highly efficient columnar format (Parquet) with effective partitioning. Using a single file per day avoids the overhead of managing many small files while still allowing parallelism across days via partitioning. Predicate pushdown ensures only necessary columns are scanned. This combination typically yields the lowest latency for subset attribute queries on large datasets.

Community comments correctly identify Parquet as the preferred format and highlight the importance of predicate pushdown. One comment notes that missing file size considerations might favor a single larger Parquet file over multiple small ORC files, reinforcing Option D as the optimal choice for minimizing query time.

Official Reference

https://docs.aws.amazon.com/athena/latest/ug/data-formats.html

This link opens the official vendor documentation in a new tab.

Exam Strategy

When optimizing Athena queries, always prioritize columnar formats (Parquet/ORC) over row-based ones (CSV/JSON/Avro). Look for answers that combine a columnar format with partitioning and mention 'predicate pushdown' or 'column pruning'. Avoid options suggesting multiple small files unless explicitly justified by parallelism needs that outweigh metadata overhead.

Frequently Asked Questions

Why is Parquet better than CSV for Athena queries?

Parquet is a columnar format that supports predicate pushdown, allowing Athena to scan only the required columns instead of reading the entire row, drastically reducing I/O.

What is predicate pushdown in Athena?

Predicate pushdown is a technique where filtering conditions are applied during data reading, so only relevant data blocks are processed, speeding up queries significantly.

More DEA-C01 FAQ →

Community Votes

D
50%
A
50%

50% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 4 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 4

  1. 9f871d2 👍 1 Answered D
    For Athena query performance on log/CSV data: Convert to Parquet (preferred over ORC in most AWS scenarios) Partition by date (or other high-cardinality filter columns) Use predicate pushdown in queries
  2. Manishkum 👍 1 Answered A
    Convert the CSV logs into multiple ORC files for better parallelism in Athena. Partition by date in Amazon S3. also Use columnar pushdown filters.
  3. AWS82siast 👍 1 Answered D
    missing file size, one parquet is still better than multiple small ORC files upto certain size.
  4. pavelkuropatin 👍 1 Answered A
    not D - single file per day is not okay

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All DEA-C01 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DEA-C01 Practice Test →

← Back to DEA-C01 Study Guide