-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor: Improve documentation for registering AnalyzerRule
#9520
Changes from all commits
00c21b1
716a2ad
d68d37a
319e3f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,9 +132,9 @@ | |
//! | ||
//! ## Customization and Extension | ||
//! | ||
//! DataFusion is a "disaggregated" query engine. This | ||
//! DataFusion is a "disaggregated" query engine. This | ||
//! means developers can start with a working, full featured engine, and then | ||
//! extend the parts of DataFusion they need to specialize for their usecase. For example, | ||
//! extend the areas they need to specialize for their usecase. For example, | ||
//! some projects may add custom [`ExecutionPlan`] operators, or create their own | ||
//! query language that directly creates [`LogicalPlan`] rather than using the | ||
//! built in SQL planner, [`SqlToRel`]. | ||
|
@@ -145,7 +145,7 @@ | |
//! * define your own catalogs, schemas, and table lists ([`CatalogProvider`]) | ||
//! * build your own query language or plans ([`LogicalPlanBuilder`]) | ||
//! * declare and use user-defined functions ([`ScalarUDF`], and [`AggregateUDF`], [`WindowUDF`]) | ||
//! * add custom optimizer rewrite passes ([`OptimizerRule`] and [`PhysicalOptimizerRule`]) | ||
//! * add custom plan rewrite passes ([`AnalyzerRule`], [`OptimizerRule`] and [`PhysicalOptimizerRule`]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. contribution 1: Mention |
||
//! * extend the planner to use user-defined logical and physical nodes ([`QueryPlanner`]) | ||
//! | ||
//! You can find examples of each of them in the [datafusion-examples] directory. | ||
|
@@ -158,6 +158,7 @@ | |
//! [`WindowUDF`]: crate::logical_expr::WindowUDF | ||
//! [`QueryPlanner`]: execution::context::QueryPlanner | ||
//! [`OptimizerRule`]: datafusion_optimizer::optimizer::OptimizerRule | ||
//! [`AnalyzerRule`]: datafusion_optimizer::analyzer::AnalyzerRule | ||
//! [`PhysicalOptimizerRule`]: crate::physical_optimizer::optimizer::PhysicalOptimizerRule | ||
//! | ||
//! # Architecture | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,12 @@ use crate::physical_optimizer::topk_aggregation::TopKAggregation; | |
use crate::{error::Result, physical_plan::ExecutionPlan}; | ||
|
||
/// `PhysicalOptimizerRule` transforms one ['ExecutionPlan'] into another which | ||
/// computes the same results, but in a potentially more efficient | ||
/// way. | ||
/// computes the same results, but in a potentially more efficient way. | ||
/// | ||
/// Use [`SessionState::add_physical_optimizer_rule`] to register additional | ||
/// `PhysicalOptimizerRule`s. | ||
/// | ||
/// [`SessionState::add_physical_optimizer_rule`]: https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionState.html#method.add_physical_optimizer_rule | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Contrbution 2: Add links to how to register these rules with SessionContext (which was the API I didn't find initially) |
||
pub trait PhysicalOptimizerRule { | ||
/// Rewrite `plan` to an optimized form | ||
fn optimize( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍