pub fn make_partitioned_execution_plan(
schema: Arc<Schema>,
reader_factory: Arc<ReaderFactory>,
state: &dyn Session,
projection: Option<&Vec<usize>>,
filters: &[Expr],
limit: Option<usize>,
partitions: Arc<Vec<Partition>>,
scan_ordering: &ScanOrdering,
) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>Expand description
Creates a partitioned execution plan for scanning Parquet files.
scan_ordering declares how the scan’s already-satisfied ordering (see
View::get_scan_output_ordering), if any, is realized:
Unordered: no ordering is declared to DataFusion.Concatenated { columns, bounds }: the file group is sorted by the leading column’s bound (read perbounds) and checked for non-overlap (erroring if violated), per-file min/max statistics are attached so DataFusion accepts the declared ordering, and the ordering is attached to the resultingFileScanConfigsoEnsureRequirementscan elide a redundantSortnode.PerFile { columns }: gated byPartition::certifies_sort_order– if every non-empty partition’s recordedsort_ordercertifiescolumns, each non-empty partition becomes its own single-file group (no overlap check, no per-file statistics – DataFusion’s multi-file-group ordering validation only needs those to prove cross-file order within a group, and single-file groups pass trivially), all declaring the samecolumnsordering for a downstreamSortPreservingMergeExec. If any non-empty partition fails to certify, this degrades to the same plan shape asUnordered.