QuestionQ264

VerifiedCost & Performance Optimisation

Editorial revision: the scenario below explicitly states the assumptions used for this question.

An ingestion job uses Apache Spark 3.5.7's standard file-based reader to read 1 TiB of uncompressed, splittable, line-delimited JSON files and later writes Parquet. Assume spark.sql.files.maxPartitionNum is unset.

The engineer wants to set the file reader's documented maximum bytes packed into a single input partition to 512 MiB (536870912 bytes), without adding a repartitioning operation. Which configuration should the engineer use?

Explanation

A is correct. spark.sql.files.maxPartitionBytes configures the documented maximum bytes packed into an input partition for file sources such as JSON. It configures the scan without requesting a repartitioning shuffle. B sets the partition count for shuffles. C advises AQE shuffle-partition sizing. D estimates the cost of opening a file when Spark packs files into partitions.

This setting does not guarantee 512-MiB Parquet output files or exactly 2,048 output files. Parquet uses a different representation and supports write compression, so JSON input bytes cannot establish Parquet output bytes.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!