Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,14 @@ config_namespace! {
/// cause regressions in both memory usage and runtime.
pub enable_window_topn: bool, default = false

/// When set to true, coalesce peer `first_value` / `last_value`
/// expressions that share the same `ORDER BY` key — e.g.
/// `first_value(a ORDER BY o), first_value(b ORDER BY o), ... GROUP BY p`
/// — into a single `first_value(named_struct(a, b, ...) ORDER BY o)`,
/// cutting N argmax scans to one pass over the input.
/// Particularly beneficial for wide payloads.
pub enable_coalesce_first_last: bool, default = false

/// When set to true, the optimizer will push TopK (Sort with fetch)
/// below hash repartition when the partition key is a prefix of the
/// sort key, reducing data volume before the shuffle.
Expand Down
9 changes: 5 additions & 4 deletions datafusion/core/src/optimizer_rule_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ Rule order matters. The default pipeline may change between releases.
| 19 | `push_down_filter` | Moves filters as early as possible through filter-commutative operators. |
| 20 | `single_distinct_aggregation_to_group_by` | Rewrites single-column `DISTINCT` aggregations into two-stage `GROUP BY` plans. |
| 21 | `eliminate_group_by_constant` | Removes constant or functionally redundant expressions from `GROUP BY`. |
| 22 | `common_sub_expression_eliminate` | Computes repeated subexpressions once and reuses the result. |
| 23 | `extract_leaf_expressions` | Pulls cheap leaf expressions closer to data sources so later pruning and filter rules can act earlier. |
| 24 | `push_down_leaf_projections` | Pushes the helper projections created by leaf extraction toward leaf inputs. |
| 25 | `optimize_projections` | Prunes unused columns and removes unnecessary logical projections. |
| 22 | `coalesce_first_last` | Coalesces peer `first_value` / `last_value` aggregates that share an `ORDER BY` into a single struct aggregate. |
| 23 | `common_sub_expression_eliminate` | Computes repeated subexpressions once and reuses the result. |
| 24 | `extract_leaf_expressions` | Pulls cheap leaf expressions closer to data sources so later pruning and filter rules can act earlier. |
| 25 | `push_down_leaf_projections` | Pushes the helper projections created by leaf extraction toward leaf inputs. |
| 26 | `optimize_projections` | Prunes unused columns and removes unnecessary logical projections. |

### Physical Optimizer Rules

Expand Down
1 change: 1 addition & 0 deletions datafusion/optimizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ regex-syntax = "0.8.9"
async-trait = { workspace = true }
criterion = { workspace = true }
ctor = { workspace = true }
datafusion-functions = { workspace = true }
datafusion-functions-aggregate = { workspace = true }
datafusion-functions-window = { workspace = true }
datafusion-functions-window-common = { workspace = true }
Expand Down
Loading