Skip to main content

Module sql_partition_spec

Module sql_partition_spec 

Source
Expand description

Specification for a view partition backed by a SQL query on the lakehouse.

Structs§

SqlPartitionSpec
A PartitionSpec implementation for SQL-defined partitions.

Functions§

fetch_sql_partition_spec
Fetches a SqlPartitionSpec by executing a count query and an extract query. sort_order declares the ordering the resulting partition’s rows are guaranteed to satisfy (see SqlBatchView::with_merge_sort_order); pass None for views that make no such guarantee.
plan_sorted_extract
Applies sort_order (if declared) to df as a DataFrame::sort over its ScanSortColumns, builds the physical plan, and – only when a sort order was declared – runs assert_single_partition and assert_ordering_satisfied against it, mirroring QueryMerger::execute_sorted_merge‘s apply-then-plan sequence (merge.rs:227-270; its four merge-specific optimizer settings have no counterpart here). With sort_order: None the plan is built unsorted and neither assertion runs. subject names the query for the assertions’ error messages (e.g. format!("extract query for {view}")); insert_range is the range being written. Returns the physical plan and the TaskContext the caller needs to execute it – callers are left to execute_stream it themselves, since only they know what to do with the resulting stream.