zhuqi-lucas commented on code in PR #26899:
URL: https://github.com/apache/datafusion/pull/26899#discussion_r4488617827
##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -233,10 +233,45 @@ impl OptimizerConfig for OptimizerContext {
}
}
-/// A rule-based logical optimizer.
+/// A rule-based optimizer for [`LogicalPlan`]s.
///
/// Applies rules in order for up to `datafusion.optimizer.max_passes` passes,
/// stopping early if the plan repeats.
+///
+/// # Built-in Optimizer Rules
Review Comment:
The deleted `optimizer_rule_reference.rs` was what failed CI when a rule was
added or reordered without updating the docs. A small test could keep that
guard here, e.g. `include_str!("optimizer.rs")`, parse the rows under this
heading and compare them with `Optimizer::new().rules` names (same for the
analyzer and physical optimizer). Fine as a follow-up.
##########
datafusion/optimizer/src/analyzer/mod.rs:
##########
@@ -48,13 +48,26 @@ pub trait AnalyzerRule: Debug {
fn name(&self) -> &str;
}
-/// Rule-based Analyzer.
+/// Rule-based Analyzer for [`LogicalPlan`]s.
///
/// Applies [`FunctionRewrite`]s and [`AnalyzerRule`]s to transform a
/// [`LogicalPlan`] in preparation for execution.
///
/// For example, the `Analyzer` applies type coercion to ensure the types of
/// operands match the types required by functions.
+///
+/// # Built-in Analyzer Rules
+///
+/// The Analyzer first applies any [`FunctionRewrite`]s added with
+/// [`Self::add_function_rewrite`].
+///
+/// The rules are applied in the following order. Note: the list may change
+/// between releases.
+///
+/// | rule | summary
|
Review Comment:
Nit: unlike the other two tables, this one has no "name in EXPLAIN plan"
column (`resolve_grouping_function`, `type_coercion`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]