Expand description
Merge consecutive parquet partitions into a single file
Structs§
- Merge
Query Result - The outcome of running a merge query.
- Query
Merger - A
PartitionMergerthat executes a SQL query to merge partitions.
Traits§
- Partition
Merger - A trait for merging partitions.
Functions§
- create_
merged_ partition - Creates a merged partition from a set of existing partitions.
- make_
merge_ session_ context - A merge is a bounded, streaming rewrite of a fixed set of files whose consumer is a single
writer task (
create_merged_partition->write_partition_from_rows), not a query that benefits from scan parallelism. Left at DataFusion’s default (true),EnsureRequirementssplits the source scan intotarget_partitionsbyte-range file groups andexecute_streamcoalesces them, so the reader working set is multiplied by the host’s core count for no throughput the writer can absorb. Forcing one sequential file group here fixes that for theUnorderedandConcatenatedshapes, which both start from a single file group spanning every input partition: left unsplit, one reader works through that group’s files one at a time instead oftarget_partitionsconcurrent byte-range readers.PerFilealready builds one file group per input partition, and this setting is load-bearing there too: left attrue,repartition_file_groups(viarepartition_preserving_order) splits each of those k per-partition groups intotarget_partitionsbyte-range groups whenever k <target_partitions, so this setting is what keepsPerFileat one reader per input file for its k-way ordered merge. Downstream parallelism is untouched: a merge query with a GROUP BY still gets its round-robin fan-out above the scan.