#[non_exhaustive]pub struct ArrowMetalConfig {
pub min_rows: usize,
pub accept_inexact: bool,
pub take_when_unknown: bool,
pub sort: bool,
pub topk: bool,
pub aggregate: bool,
pub filter: bool,
pub aggregate_choice: AggregateChoice,
pub table_rows: Option<usize>,
pub join: bool,
pub join_choice: JoinChoice,
pub report_plans: usize,
}Expand description
When the rule takes a node.
Default is the measured take-list; ArrowMetalConfig::all takes every shape the rule can
translate (what the differential grid and the benchmark use).
The fields are public to read and to set on a value (let mut c = ArrowMetalConfig::all(); c.min_rows = 0;); outside this crate a config is built from Default or
ArrowMetalConfig::all and the with_* methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.min_rows: usizeTake a node only when its input has at least this many rows.
accept_inexact: boolUse an inexact (estimated) row count as if it were exact. Default: no.
take_when_unknown: boolTake a node whose input row count is unknown. Default: no (leave it).
sort: boolFull sorts: ORDER BY without LIMIT.
topk: boolTop-k: ORDER BY ... LIMIT (a sort with a fetch).
aggregate: boolAggregates (GROUP BY, DISTINCT). Who runs a replaced one is aggregate_choice.
filter: boolFilters: a FilterExec whose predicate translates.
aggregate_choice: AggregateChoiceWho runs a replaced aggregate. Default: AggregateChoice::Measured.
table_rows: Option<usize>Under AggregateChoice::Measured, look the measured table up at this row count instead of
the input’s, at plan time and at run time (tests and experiments; default None).
join: boolHash joins (HashJoinExec: inner, left, right on equal keys). Which ones is join_choice.
join_choice: JoinChoiceWhich translatable joins are replaced. Default: JoinChoice::Measured.
report_plans: usizeThe report keeps the decisions of the last this many plans the rule optimized (an EXPLAIN and each execution plan count one each), with the run-time decisions of their nodes. Default 64; 0 keeps one.
Implementations§
Source§impl ArrowMetalConfig
impl ArrowMetalConfig
Sourcepub fn all() -> Self
pub fn all() -> Self
Every shape the rule can translate (sorts, top-k, aggregates, filters, joins), at the
default min_rows. Aggregates and joins are still decided by their measured tables unless
aggregate_choice and join_choice say
otherwise.
Sourcepub fn with_min_rows(self, rows: usize) -> Self
pub fn with_min_rows(self, rows: usize) -> Self
Sets min_rows.
Sourcepub fn with_accept_inexact(self, on: bool) -> Self
pub fn with_accept_inexact(self, on: bool) -> Self
Sets accept_inexact.
Sourcepub fn with_take_when_unknown(self, on: bool) -> Self
pub fn with_take_when_unknown(self, on: bool) -> Self
Sets take_when_unknown.
Sourcepub fn with_aggregate(self, on: bool) -> Self
pub fn with_aggregate(self, on: bool) -> Self
Sets aggregate.
Sourcepub fn with_filter(self, on: bool) -> Self
pub fn with_filter(self, on: bool) -> Self
Sets filter.
Sourcepub fn with_aggregate_choice(self, choice: AggregateChoice) -> Self
pub fn with_aggregate_choice(self, choice: AggregateChoice) -> Self
Sets aggregate_choice.
Sourcepub fn with_table_rows(self, rows: Option<usize>) -> Self
pub fn with_table_rows(self, rows: Option<usize>) -> Self
Sets table_rows.
Sourcepub fn with_join_choice(self, choice: JoinChoice) -> Self
pub fn with_join_choice(self, choice: JoinChoice) -> Self
Sets join_choice.
Sourcepub fn with_report_plans(self, plans: usize) -> Self
pub fn with_report_plans(self, plans: usize) -> Self
Sets report_plans.
Trait Implementations§
Source§impl Clone for ArrowMetalConfig
impl Clone for ArrowMetalConfig
Source§impl Debug for ArrowMetalConfig
impl Debug for ArrowMetalConfig
Source§impl Default for ArrowMetalConfig
The default take-list, from the rule on/off measurement against DataFusion 55.1 on an M4 Max
(16 partitions; MemTables of 8192-row batches and of one batch per partition; this crate with
one totalOrder key per ORDER BY key and the chunked import;
datafusion/results/datafusion_rule_2026-09-29.csv, rows crate = now; DataFusion alone /
DataFusion with the rule, wall, best of 5, both layouts):
impl Default for ArrowMetalConfig
The default take-list, from the rule on/off measurement against DataFusion 55.1 on an M4 Max
(16 partitions; MemTables of 8192-row batches and of one batch per partition; this crate with
one totalOrder key per ORDER BY key and the chunked import;
datafusion/results/datafusion_rule_2026-09-29.csv, rows crate = now; DataFusion alone /
DataFusion with the rule, wall, best of 5, both layouts):
| shape | 1M | 10M | 50M | default |
|---|---|---|---|---|
| ORDER BY int64 / Float64 / String / Float32 key, 3 columns | 5.9x - 12.8x | 19.2x - 28.7x | 18.9x - 27.2x | taken |
| the same over DataFusion’s Parquet scan (snappy, zstd) | 13.6x, 10.8x | 16.5x, 13.8x | taken | |
| ORDER BY … LIMIT 100 (int64, Float64 DESC, Float32 DESC) | 0.14x - 0.49x | 0.24x - 0.41x | 0.17x - 0.29x | left |
| WHERE + whole-table sum/count (the filter is what is taken) | 0.56x - 0.59x | 0.62x - 0.72x | 0.74x | left |
| Parquet WHERE + GROUP BY | 0.52x - 0.53x | 0.54x - 0.55x | left |
Full sorts at smaller inputs (every key type, both layouts): 100k rows 1.34x - 2.63x, 250k
2.64x - 4.80x, 500k 4.32x - 7.49x; the 1x crossover is below 100k for every key, and 250k is
the first measured size at which every key type is at or above 2.6x; hence min_rows 250,000.
Top-k is left: DataFusion’s TopK answers LIMIT 100 over 50M rows in 4.6 - 6.5 ms; the rule’s GPU top-k takes 20 - 29 ms there, of which collecting the input stream alone is 6.5 - 8 ms.
Aggregates (GROUP BY, DISTINCT) are decided per shape and group count
(AggregateChoice::Measured): the same SQL is ahead of DataFusion at some group counts and
behind at others, and the rule sees the row count but not the group count (DataFusion’s
MemTable and Parquet statistics carry no distinct counts). The rule replaces an aggregate when
the measured table (src/agg_table.rs, generated by scripts/groupby_table.py from the sweep
CSV it names) takes its shape at some group count at the input’s exact row count; the
MetalExec then estimates the group count from a sample of the keys and runs on ArrowMetal only
at a bucket the table takes, handing the node back to DataFusion otherwise. Hash joins are
replaced where the measured join table (src/join_table.rs, generated by
scripts/join_table.py from the join CSV it names) takes their join type, key type and build
and probe row counts (JoinChoice::Measured).
Auto Trait Implementations§
impl Freeze for ArrowMetalConfig
impl RefUnwindSafe for ArrowMetalConfig
impl Send for ArrowMetalConfig
impl Sync for ArrowMetalConfig
impl Unpin for ArrowMetalConfig
impl UnsafeUnpin for ArrowMetalConfig
impl UnwindSafe for ArrowMetalConfig
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more