A solar installer stores inverter readings in Amazon S3 as Parquet, partitioned by day under Hive-style prefixes such as dt=2026-10-19/. The Athena table has dt as its partition column and also has an event_time timestamp column.
Analysts report that a query for one day of readings scans the whole table. Their queries filter only with WHERE event_time BETWEEN two timestamps.
Which change will reduce the data that each query scans?
Choose one answer.
AA. Add a filter on the dt partition column for the same day, so that Athena reads only that partition's files.
BB. Run MSCK REPAIR TABLE before each query, so that Athena loads all of the table's partitions into the Data Catalog.
CC. Add a LIMIT clause to each query, so that Athena stops reading files once it has returned enough rows.
DD. Rewrite the Parquet files as gzip-compressed CSV, so that each file is smaller and faster to read.
Show the answer and explanation
Answer: A
A. Right: Correct. Athena prunes partitions only when the query filters on the partition column. A predicate on dt limits the scan to the matching day, while the event_time filter still trims rows within it. Learn more: Partition your data (opens in a new tab)
B. Wrong: MSCK REPAIR TABLE adds Hive-style partitions that are missing from the catalog. The partitions are already registered here, and loading them does not make a query on event_time skip any of them. Learn more: MSCK REPAIR TABLE (opens in a new tab)
C. Wrong: Athena charges for the data a query scans, and a LIMIT clause does not stop it from reading every partition before filtering. The scan stays the same size.
D. Wrong: CSV is a row format, so Athena must read every column, and the query would still scan every day. The change makes scans larger, not smaller.
Explanation
Partitioning saves scan cost only when queries filter on the partition column. A filter on a regular column such as event_time does not tell Athena which dt folders it can skip, so adding a dt predicate limits the scan to one day. Repairing partitions, LIMIT clauses and CSV files do not reduce the scan.
Want more on Partitioning, compression and optimization? The 5 full-length practice sets have 5 more Partitioning, compression and optimization questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →