Skip to content
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: replace {..} with (_), typo, remove outdated TODO #4286

Merged
merged 3 commits into from
Nov 18, 2022
Merged
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
8 changes: 2 additions & 6 deletions datafusion/core/src/physical_plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ impl DefaultPhysicalPlanner {
// provided expressions into logical Column expressions if their results
// are already provided from the input plans. Because we work with
// qualified columns in logical plane, derived columns involve operators or
// functions will contain qualifers as well. This will result in logical
// functions will contain qualifiers as well. This will result in logical
// columns with names like `SUM(t1.c1)`, `t1.c1 + t1.c2`, etc.
//
// If we run these logical columns through physical_name function, we will
Expand Down Expand Up @@ -2281,11 +2281,7 @@ mod tests {
unimplemented!("NoOpExecutionPlan::execute");
}

fn fmt_as(
&self,
t: DisplayFormatType,
f: &mut std::fmt::Formatter,
) -> std::fmt::Result {
fn fmt_as(&self, t: DisplayFormatType, f: &mut fmt::Formatter) -> fmt::Result {
match t {
DisplayFormatType::Default => {
write!(f, "NoOpExecutionPlan")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ impl ExecutionPlan for WindowAggExec {
is_exact: input_stat.is_exact,
num_rows: input_stat.num_rows,
column_statistics: Some(column_statistics),
// TODO stats: knowing the type of the new columns we can guess the output size
total_byte_size: None,
}
}
Expand Down
8 changes: 4 additions & 4 deletions datafusion/expr/src/logical_plan/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub enum LogicalPlan {
Extension(Extension),
/// Remove duplicate rows from the input
Distinct(Distinct),
/// Set a Varaible
/// Set a Variable
SetVariable(SetVariable),
}

Expand Down Expand Up @@ -254,7 +254,7 @@ impl LogicalPlan {
LogicalPlan::Sort(Sort { expr, .. }) => expr.clone(),
LogicalPlan::Extension(extension) => extension.node.expressions(),
// plans without expressions
LogicalPlan::TableScan { .. }
LogicalPlan::TableScan(_)
| LogicalPlan::EmptyRelation(_)
| LogicalPlan::Subquery(_)
| LogicalPlan::SubqueryAlias(_)
Expand All @@ -268,8 +268,8 @@ impl LogicalPlan {
| LogicalPlan::SetVariable(_)
| LogicalPlan::DropView(_)
| LogicalPlan::CrossJoin(_)
| LogicalPlan::Analyze { .. }
| LogicalPlan::Explain { .. }
| LogicalPlan::Analyze(_)
| LogicalPlan::Explain(_)
| LogicalPlan::Union(_)
| LogicalPlan::Distinct(_) => {
vec![]
Expand Down
10 changes: 5 additions & 5 deletions datafusion/optimizer/src/common_subexpr_eliminate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,19 @@ impl OptimizerRule for CommonSubexprEliminate {
fetch: *fetch,
}))
}
LogicalPlan::Join { .. }
LogicalPlan::Join(_)
| LogicalPlan::CrossJoin(_)
| LogicalPlan::Repartition(_)
| LogicalPlan::Union(_)
| LogicalPlan::TableScan { .. }
| LogicalPlan::TableScan(_)
| LogicalPlan::Values(_)
| LogicalPlan::EmptyRelation(_)
| LogicalPlan::Subquery(_)
| LogicalPlan::SubqueryAlias(_)
| LogicalPlan::Limit(_)
| LogicalPlan::CreateExternalTable(_)
| LogicalPlan::Explain { .. }
| LogicalPlan::Analyze { .. }
| LogicalPlan::Explain(_)
| LogicalPlan::Analyze(_)
| LogicalPlan::CreateMemoryTable(_)
| LogicalPlan::CreateView(_)
| LogicalPlan::CreateCatalogSchema(_)
Expand All @@ -242,7 +242,7 @@ impl OptimizerRule for CommonSubexprEliminate {
| LogicalPlan::DropView(_)
| LogicalPlan::SetVariable(_)
| LogicalPlan::Distinct(_)
| LogicalPlan::Extension { .. } => {
| LogicalPlan::Extension(_) => {
// apply the optimization to all inputs of the plan
utils::optimize_children(self, plan, optimizer_config)
}
Expand Down
10 changes: 5 additions & 5 deletions datafusion/optimizer/src/projection_push_down.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ fn get_projected_schema(

// create the projected schema
let projected_fields: Vec<DFField> = match table_name {
Some(qualifer) => projection
Some(qualifier) => projection
.iter()
.map(|i| DFField::from_qualified(qualifer, schema.fields()[*i].clone()))
.map(|i| DFField::from_qualified(qualifier, schema.fields()[*i].clone()))
.collect(),
None => projection
.iter()
Expand Down Expand Up @@ -610,7 +610,7 @@ mod tests {
}

#[test]
fn redundunt_project() -> Result<()> {
fn redundant_project() -> Result<()> {
let table_scan = test_table_scan()?;

let plan = LogicalPlanBuilder::from(table_scan)
Expand Down Expand Up @@ -641,7 +641,7 @@ mod tests {
}

#[test]
fn noncontiguous_redundunt_projection() -> Result<()> {
fn noncontinuous_redundant_projection() -> Result<()> {
let table_scan = test_table_scan()?;

let plan = LogicalPlanBuilder::from(table_scan)
Expand Down Expand Up @@ -747,7 +747,7 @@ mod tests {

#[test]
fn join_schema_trim_using_join() -> Result<()> {
// shared join colums from using join should be pushed to both sides
// shared join columns from using join should be pushed to both sides

let table_scan = test_table_scan()?;

Expand Down