QuestionQ190

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 JSON 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 configure the file reader's documented maximum number of bytes packed into a single input partition to 512 MiB (536870912 bytes), without adding a repartitioning operation. Which setting should be configured before reading the JSON files?

Explanation

A is correct. spark.sql.files.maxPartitionBytes controls the bytes packed into an input partition for file sources including JSON. Configuring the scan does not request a shuffle. B controls shuffle partition count; C is an advisory size for AQE shuffle partitions. D limits output records per file. E represents estimated file-opening cost when packing files, rather than the requested input-partition byte limit.

This setting does not guarantee 512-MiB Parquet files or exactly 2,048 output files. It concerns input planning; Parquet has its own columnar representation and write compression. Output sizing therefore cannot be inferred directly from JSON input bytes.

Learn more

Community Discussion

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