nerdexam
Amazon

DAS-C01 · Question #155

A company stores Apache Parquet-formatted files in Amazon S3. The company uses an AWS Glue Data Catalog to store the table metadata and Amazon Athena to query and analyze the data. The tables have a…

The correct answer is C. Use partition projection to speed up the processing of the partitioned table. To reduce Amazon Athena query runtime for tables with a large number of partitions, particularly when queries target small data subsets, configuring partition projection is the most effective solution.

Analysis and Visualization

Question

A company stores Apache Parquet-formatted files in Amazon S3. The company uses an AWS Glue Data Catalog to store the table metadata and Amazon Athena to query and analyze the data. The tables have a large number of partitions. The queries are only run on small subsets of data in the table. A data analyst adds new time partitions into the table as new data arrives. The data analyst has been asked to reduce the query runtime. Which solution will provide the MOST reduction in the query runtime?

Options

  • AConvert the Parquet files to the csv file format..Then attempt to query the data again
  • BConvert the Parquet files to the Apache ORC file format. Then attempt to query the data again
  • CUse partition projection to speed up the processing of the partitioned table
  • DAdd more partitions to be used over the table. Then filter over two partitions and put all columns

How the community answered

(40 responses)
  • A
    8% (3)
  • B
    13% (5)
  • C
    78% (31)
  • D
    3% (1)

Why each option

To reduce Amazon Athena query runtime for tables with a large number of partitions, particularly when queries target small data subsets, configuring partition projection is the most effective solution.

AConvert the Parquet files to the csv file format..Then attempt to query the data again

Converting Parquet files (a columnar format) to CSV (a row-oriented format) would likely increase, not reduce, query runtime because columnar formats are generally more efficient for analytical queries due to better compression and projection pushdown capabilities.

BConvert the Parquet files to the Apache ORC file format. Then attempt to query the data again

Converting Parquet files to Apache ORC format, while also a columnar format, would not address the core performance bottleneck caused by a large number of partitions. Any performance difference between Parquet and ORC would be marginal compared to the impact of optimizing partition discovery.

CUse partition projection to speed up the processing of the partitioned tableCorrect

Partition projection in Amazon Athena significantly reduces query runtime for tables with a very large number of partitions by allowing Athena to infer partition locations and values based on a defined pattern, rather than listing them from the AWS Glue Data Catalog. This eliminates the overhead of retrieving extensive metadata, making partition pruning more efficient and speeding up queries on small subsets of data.

DAdd more partitions to be used over the table. Then filter over two partitions and put all columns

Adding more partitions to a table would exacerbate the problem if the bottleneck is partition discovery from the Glue Data Catalog, as it increases the amount of metadata Athena needs to process. While filtering partitions is good practice, simply adding more is counterproductive to reducing query runtime.

Concept tested: Athena partition projection for query optimization

Source: https://docs.aws.amazon.com/athena/latest/ug/partition-projection.html

Topics

#Amazon Athena#Partition Projection#Query Optimization#AWS Glue Data Catalog

Community Discussion

No community discussion yet for this question.

Full DAS-C01 Practice