Skip to main content

assert_ordering_satisfied

Function assert_ordering_satisfied 

Source
pub fn assert_ordering_satisfied(
    plan: &Arc<dyn ExecutionPlan>,
    columns: &[ScanSortColumn],
    label: &str,
    subject: &str,
    insert_range: TimeRange,
    reason: &str,
) -> Result<(), Error>
Expand description

Bails unless plan’s output ordering satisfies the declared columns, defensively re-verifying that a sort_order guarantee about to be recorded on a fresh partition is truthful. label is a short noun phrase used in the intermediate error-context messages (e.g. "per-file merge" or "extract-query"); subject names the query for the bail message; reason supplies the full, call-site-specific trailing text of the bail message (what was declared, and any guidance for diagnosing a mismatch). Shared by the two paths that record a sort_order guarantee: QueryMerger::execute_sorted_merge and sql_partition_spec::plan_sorted_extract. QueryMerger::execute_concatenated_merge does not call this – its ordering is a structural property of the sorted, non-overlapping file group rather than a query-plan sort DataFusion could get wrong.