Cost-Effective SQL Queries on Encrypted Parquet in S3

SAA-C03 By islever Editorial Last updated

Short answer

A Configure Amazon Athena to read the encrypted files and run SQL queries directly on the data in Amazon S3.

Question

A weather forecasting company collects temperature readings from various sensors on a continuous basis. An existing data ingestion process collects the readings and aggregates the readings into larger Apache Parquet files. Then the process encrypts the files by using client-side encryption with KMS managed keys (CSE-KMS). Finally, the process writes the files to an Amazon S3 bucket with separate prefixes for each calendar day. The company wants to run occasional SQL queries on the data to take sample moving averages for a specific calendar day. Which solution will meet these requirements MOST cost-effectively?
  1. Configure Amazon Athena to read the encrypted files. Run SQL queries on the data directly in Amazon S3. Correct Answer
  2. Use Amazon S3 Select to run SQL queries on the data directly in Amazon S3.
  3. Configure Amazon Redshift to read the encrypted files. Use Redshift Spectrum and Redshift query editor v2 to run SQL queries on the data directly in Amazon S3.
  4. Configure Amazon EMR Serverless to read the encrypted files. Use Apache SparkSQL to run SQL queries on the data directly in Amazon S3.

Key Takeaways

The core concept tested is selecting the right managed analytics service for ad-hoc SQL on S3 data, with the common trap being the assumption that S3 Select or Redshift Spectrum are cheaper than Athena for simple, occasional workloads.

This question evaluates the most cost-effective method for running occasional SQL queries on client-side encrypted Apache Parquet files stored in Amazon S3. The correct solution leverages a serverless query service that natively supports encryption handling without infrastructure management.

Common mistake: Many learners choose Option B (S3 Select) because it appears simpler and potentially cheaper, but S3 Select does not support complex SQL aggregations like moving averages or client-side KMS decryption efficiently for this use case compared to Athena's broader SQL engine capabilities.

Expert Analysis

Why the Answer Is Correct

Amazon Athena is the most cost-effective solution because it is serverless, meaning you pay only for the queries run (per TB scanned). It natively supports Apache Parquet format and can handle Client-Side Encryption with KMS (CSE-KMS) by using the AWS SDKs or by configuring the Glue Data Catalog metadata correctly if the key access is managed via IAM roles that assume permissions to decrypt. Since the queries are "occasional" and involve "moving averages" (aggregations), Athena provides the necessary SQL engine power without the overhead of managing clusters.

Why the Other Options Are Wrong

Option B (S3 Select) is limited to retrieving subsets of data from objects using simple SQL; it does not support complex aggregations like moving averages across multiple rows effectively for this specific analytical need, nor does it easily handle CSE-KMS for arbitrary SQL queries in the same flexible way Athena does for structured data analysis. Option C (Redshift Spectrum) involves setting up a Redshift cluster, which incurs hourly costs regardless of usage, making it significantly more expensive for "occasional" queries. Option D (EMR Serverless) requires managing Spark jobs and cluster configurations, adding operational complexity and cost compared to a simple serverless SQL interface like Athena.

Community Comment Notes

Community consensus heavily favors Athena, noting its suitability for Parquet and cost-effectiveness. One commenter pointed out that "Athena is serverless... super cost-effective because you only pay for the amount of data scanned." Another highlighted that Athena works perfectly with Parquet files. A dissenting voice argued that options A, B, and C do not support CSE-KMS directly, but this is incorrect as Athena can be configured to work with encrypted data through proper IAM and encryption context setups, or by assuming the keys are accessible. The majority correctly identified that for occasional SQL on S3, Athena is the standard answer.

Official Reference

https://docs.aws.amazon.com/athena/latest/ug/querying-s3-data-files.html

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

Exam Strategy

Always look for 'serverless' and 'pay-per-use' keywords when 'cost-effective' and 'occasional' are specified. If the task involves SQL on S3 data (especially Parquet/ORC), Athena is usually the primary candidate unless the volume is massive and continuous (then consider Redshift Spectrum) or extremely simple (S3 Select).

Frequently Asked Questions

Does Athena support Client-Side Encryption with KMS?

Yes, Athena can query data encrypted with CSE-KMS if the IAM role used by Athena has permission to decrypt the data using the KMS key.

Why is S3 Select not better for this scenario?

S3 Select is optimized for retrieving subsets of data from individual objects, whereas Athena provides a full SQL engine capable of complex aggregations like moving averages across datasets.

More SAA-C03 FAQ →

Community Votes

A
100%

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

Discussion 7 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 7

  1. LeonSauveterre 👍 2 Answered A
    Seems like "sample moving averages" is a typo of "simple moving averages". A simple moving average is formed by computing the average price of a security over a specific number of periods, but let's just ignore it if you don't care one bit haha A - Athena is serverless, works perfectly with Parquet files, can handle encrypted data, and super cost-effective because you only pay for the amount of data you query. B - Amazon S3 Select is fast for simple filtering or lightweight queries, not for complex queries like calculating moving averages. C - Redshift with Redshift Spectrum is extremely powerful and competent to crunch heavy-duty data, so overkill for occasional SQL queries. D - EMR is scalable and fast but is usually for heavy data pipelines, not casual SQL analysis. Like C, this is overkill.
  2. Ronanh 👍 2
    A. Athena would be overkill and more expensive for simple queries on specific files. C. Amazon Redshift with Redshift Spectrum would be significantly more complex and costly to set up and maintain for occasional queries. D. EMR Serverless with Apache SparkSQL would also be more complex and likely more expensive for this use case. S3 Select provides the right balance of functionality and cost-effectiveness for the described scenario, making it the most suitable choice
  3. EllenLiu 👍 1 Answered A
    it is a simple SQL just in S3, believe it is a use case of Athena which supports client-side decryption
  4. FlyingHawk 👍 1 Answered A
    https://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/
  5. Cpso 👍 1 Answered D
    Key: CSE-KMS A,B,C not support decrypted by CSE-KMS
Show 2 more comments
  1. swati1508 👍 3 Answered A
    Athena for sql
  2. dhewa 👍 2 Answered A
    A is my choice.

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.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All SAA-C03 Questions

Access 120 questions with complete answers and detailed explanations.

View Full SAA-C03 Practice Test →

← Back to SAA-C03 Study Guide