Skip to content

Apache DataFusion SQL Query Engine

minor: remove redundant prefix. (#3973)

jakevin00d23a2b98bc
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 18b90943fe..0b9ff3a46b 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -6,18 +6,21 @@ We generally require a GitHub issue to be filed for all bug fixes and enhancemen
Closes #.
- # Rationale for this change
+# Rationale for this change
+
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
+
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
+
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
diff --git a/datafusion/expr/src/logical_plan/display.rs b/datafusion/expr/src/logical_plan/display.rs
index 757d130d48..2fcd033e19 100644
--- a/datafusion/expr/src/logical_plan/display.rs
+++ b/datafusion/expr/src/logical_plan/display.rs
@@ -48,7 +48,7 @@ impl<'a, 'b> IndentVisitor<'a, 'b> {
impl<'a, 'b> PlanVisitor for IndentVisitor<'a, 'b> {
type Error = fmt::Error;
- fn pre_visit(&mut self, plan: &LogicalPlan) -> std::result::Result<bool, fmt::Error> {
+ fn pre_visit(&mut self, plan: &LogicalPlan) -> Result<bool, fmt::Error> {
if self.indent > 0 {
writeln!(self.f)?;
}
@@ -66,10 +66,7 @@ impl<'a, 'b> PlanVisitor for IndentVisitor<'a, 'b> {
Ok(true)
}
- fn post_visit(
- &mut self,
- _plan: &LogicalPlan,
- ) -> std::result::Result<bool, fmt::Error> {
+ fn post_visit(&mut self, _plan: &LogicalPlan) -> Result<bool, fmt::Error> {
self.indent -= 1;
Ok(true)
}
@@ -190,7 +187,7 @@ impl<'a, 'b> GraphvizVisitor<'a, 'b> {
impl<'a, 'b> PlanVisitor for GraphvizVisitor<'a, 'b> {
type Error = fmt::Error;
- fn pre_visit(&mut self, plan: &LogicalPlan) -> std::result::Result<bool, fmt::Error> {
+ fn pre_visit(&mut self, plan: &LogicalPlan) -> Result<bool, fmt::Error> {
let id = self.graphviz_builder.next_id();
// Create a new graph node for `plan` such as
@@ -226,10 +223,7 @@ impl<'a, 'b> PlanVisitor for GraphvizVisitor<'a, 'b> {
Ok(true)
}
- fn post_visit(
- &mut self,
- _plan: &LogicalPlan,
- ) -> std::result::Result<bool, fmt::Error> {
+ fn post_visit(&mut self, _plan: &LogicalPlan) -> Result<bool, fmt::Error> {
// always be non-empty as pre_visit always pushes
// So it should always be Ok(true)
let res = self.parent_ids.pop();
diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs
index cb3f7f97df..284e8c9aa4 100644
--- a/datafusion/expr/src/logical_plan/plan.rs
+++ b/datafusion/expr/src/logical_plan/plan.rs
@@ -378,17 +378,13 @@ pub trait PlanVisitor {
/// visited. If Ok(true) is returned, the recursion continues. If
/// Err(..) or Ok(false) are returned, the recursion stops
/// immediately and the error, if any, is returned to `accept`
- fn pre_visit(&mut self, plan: &LogicalPlan)
- -> std::result::Result<bool, Self::Error>;
+ fn pre_visit(&mut self, plan: &LogicalPlan) -> Result<bool, Self::Error>;
/// Invoked on a logical plan after all of its child inputs have
/// been visited. The return value is handled the same as the
/// return value of `pre_visit`. The provided default implementation
/// returns `Ok(true)`.
- fn post_visit(
- &mut self,
- _plan: &LogicalPlan,
- ) -> std::result::Result<bool, Self::Error> {
+ fn post_visit(&mut self, _plan: &LogicalPlan) -> Result<bool, Self::Error> {
Ok(true)
}
}
@@ -398,7 +394,7 @@ impl LogicalPlan {
/// all nodes were visited, and Ok(false) if any call to
/// `pre_visit` or `post_visit` returned Ok(false) and may have
/// cut short the recursion
- pub fn accept<V>(&self, visitor: &mut V) -> std::result::Result<bool, V::Error>
+ pub fn accept<V>(&self, visitor: &mut V) -> Result<bool, V::Error>
where
V: PlanVisitor,
{
@@ -545,12 +541,12 @@ impl LogicalPlan {
/// assert_eq!("Filter: t1.id = Int32(5)\n TableScan: t1",
/// display_string);
/// ```
- pub fn display_indent(&self) -> impl fmt::Display + '_ {
+ pub fn display_indent(&self) -> impl Display + '_ {
// Boilerplate structure to wrap LogicalPlan with something
// that that can be formatted
struct Wrapper<'a>(&'a LogicalPlan);
- impl<'a> fmt::Display for Wrapper<'a> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ impl<'a> Display for Wrapper<'a> {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let with_schema = false;
let mut visitor = IndentVisitor::new(f, with_schema);
match self.0.accept(&mut visitor) {
@@ -588,12 +584,12 @@ impl LogicalPlan {
/// \n TableScan: t1 [id:Int32]",
/// display_string);
/// ```
- pub fn display_indent_schema(&self) -> impl fmt::Display + '_ {
+ pub fn display_indent_schema(&self) -> impl Display + '_ {
// Boilerplate structure to wrap LogicalPlan with something
// that that can be formatted
struct Wrapper<'a>(&'a LogicalPlan);
- impl<'a> fmt::Display for Wrapper<'a> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ impl<'a> Display for Wrapper<'a> {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let with_schema = true;
let mut visitor = IndentVisitor::new(f, with_schema);
match self.0.accept(&mut visitor) {
@@ -634,12 +630,12 @@ impl LogicalPlan {
/// dot -Tpdf < /tmp/example.dot > /tmp/example.pdf
/// ```
///
- pub fn display_graphviz(&self) -> impl fmt::Display + '_ {
+ pub fn display_graphviz(&self) -> impl Display + '_ {
// Boilerplate structure to wrap LogicalPlan with something
// that that can be formatted
struct Wrapper<'a>(&'a LogicalPlan);
- impl<'a> fmt::Display for Wrapper<'a> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ impl<'a> Display for Wrapper<'a> {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
writeln!(
f,
"// Begin DataFusion GraphViz Plan (see https://graphviz.org)"
@@ -686,12 +682,12 @@ impl LogicalPlan {
///
/// assert_eq!("TableScan: t1", display_string);
/// ```
- pub fn display(&self) -> impl fmt::Display + '_ {
+ pub fn display(&self) -> impl Display + '_ {
// Boilerplate structure to wrap LogicalPlan with something
// that that can be formatted
struct Wrapper<'a>(&'a LogicalPlan);
- impl<'a> fmt::Display for Wrapper<'a> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ impl<'a> Display for Wrapper<'a> {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self.0 {
LogicalPlan::EmptyRelation(_) => write!(f, "EmptyRelation"),
LogicalPlan::Values(Values { ref values, .. }) => {
@@ -957,8 +953,8 @@ impl LogicalPlan {
}
}
-impl fmt::Debug for LogicalPlan {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+impl Debug for LogicalPlan {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
self.display_indent().fmt(f)
}
}
@@ -1554,8 +1550,8 @@ pub enum PlanType {
FinalPhysicalPlan,
}
-impl fmt::Display for PlanType {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+impl Display for PlanType {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
PlanType::InitialLogicalPlan => write!(f, "initial_logical_plan"),
PlanType::OptimizedLogicalPlan { optimizer_name } => {