nerdexam
Amazon

DAS-C01 · Question #20

A transportation company uses IoT sensors attached to trucks to collect vehicle data for its global delivery fleet. The company currently sends the sensor data in small .csv files to Amazon S3. The…

The correct answer is D. Use AWS Glue to convert the files from .csv to Apache Parquet to create 20 Parquet files. To optimize querying costs and improve Redshift loading speed for small CSV files, convert them into a columnar format like Apache Parquet using AWS Glue. Creating a number of Parquet files that matches the Amazon Redshift cluster's slice count (20 files for a 10-node, 2-slice…

Processing

Question

A transportation company uses IoT sensors attached to trucks to collect vehicle data for its global delivery fleet. The company currently sends the sensor data in small .csv files to Amazon S3. The files are then loaded into a 10-node Amazon Redshift cluster with two slices per node and queried using both Amazon Athena and Amazon Redshift. The company wants to optimize the files to reduce the cost of querying and also improve the speed of data loading into the Amazon Redshift cluster. Which solution meets these requirements?

Options

  • AUse AWS Glue to convert all the files from .csv to a single large Apache Parquet file.
  • BUse Amazon EMR to convert each .csv file to Apache Avro.
  • CUse AWS Glue to convert the files from .csv to a single large Apache ORC file.
  • DUse AWS Glue to convert the files from .csv to Apache Parquet to create 20 Parquet files.

How the community answered

(47 responses)
  • A
    21% (10)
  • B
    6% (3)
  • C
    13% (6)
  • D
    60% (28)

Why each option

To optimize querying costs and improve Redshift loading speed for small CSV files, convert them into a columnar format like Apache Parquet using AWS Glue. Creating a number of Parquet files that matches the Amazon Redshift cluster's slice count (20 files for a 10-node, 2-slice per node cluster) ensures efficient parallel loading and query execution for both Redshift and Athena.

AUse AWS Glue to convert all the files from .csv to a single large Apache Parquet file.

While converting to Parquet is good, creating a single large Parquet file will prevent parallel loading into a multi-slice Amazon Redshift cluster, significantly slowing down the ingestion process as only one slice can process the single file. It also limits query parallelism for services like Athena.

BUse Amazon EMR to convert each .csv file to Apache Avro.

Apache Avro is a row-oriented format, which is generally less efficient than columnar formats like Parquet or ORC for analytical queries that often select a subset of columns. Using Amazon EMR for this task is also less managed than AWS Glue, and converting 'each .csv file' might still lead to many small Avro files, negating consolidation benefits.

CUse AWS Glue to convert the files from .csv to a single large Apache ORC file.

Similar to option A, converting to a single large Apache ORC file will bottleneck data loading into Amazon Redshift by preventing parallel ingestion across the cluster's slices. While ORC is a good columnar format, the file sizing is suboptimal for Redshift's parallel loading architecture.

DUse AWS Glue to convert the files from .csv to Apache Parquet to create 20 Parquet files.Correct

Converting small CSV files into Apache Parquet using AWS Glue improves query performance and reduces costs for both Amazon Athena and Redshift Spectrum due to its columnar storage and compression. Crucially, creating 20 Parquet files (matching the 20 slices in the 10-node Redshift cluster) enables highly parallel and efficient data loading into Redshift using the COPY command, directly addressing all requirements.

Concept tested: Data lake optimization and Redshift loading best practices

Source: https://docs.aws.amazon.com/redshift/latest/dg/t_Loading_data_from_S3.html

Topics

#Data Format Optimization#Apache Parquet#AWS Glue ETL#Redshift Data Loading

Community Discussion

No community discussion yet for this question.

Full DAS-C01 Practice