Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Describe common formats for data files

A worked example

Complete the statement

A company needs file formats for two datasets.

  • Sales history: a large dataset in a data lake. Analysts' queries usually read only a few columns. The data for each column must be stored together, and metadata in the file must let an application locate the relevant row groups and find the chunks for the requested columns.
  • Telemetry: records are sent over a low-bandwidth network link. The format must store data row by row. Each file must include a header containing a schema expressed in JSON that describes the records' structure. The records themselves must be stored as compact binary data to reduce storage and network bandwidth.

Which file format should the company use for each dataset?

Store the sales history as files and store the telemetry as files.

  • Blank 1: Parquet (correct answer)

    Parquet is columnar. Its row groups store each column's data together, and its metadata lets an application locate the relevant row groups and read the chunks for the requested columns. Avro is row-based, not columnar. CSV stores delimited rows of text, so column data is not stored together. JSON is a hierarchical text document format, not a columnar format with row-group metadata.

  • Blank 2: Avro (correct answer)

    Avro is row-based. Its file header contains a schema expressed in JSON, and the records are stored as binary blocks, which helps minimize storage and network bandwidth. Parquet is columnar, not row-based. CSV is plain delimited text with an optional line of field names, rather than binary records with an embedded schema. JSON stores the whole document as human-readable text, not as binary blocks.

Why

The sales history needs column data stored together, plus metadata for locating chunks. That is how Parquet organizes data in row groups and chunks. The telemetry needs a row-based format with a schema expressed in JSON embedded in its file header and records encoded as binary. Avro provides this structure and is good for minimizing storage and network bandwidth. The text formats CSV and JSON fail both datasets' requirements for optimized storage.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free