Skip to content

Commit

Permalink
fix unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayu Liu committed May 21, 2021
1 parent 1d3b076 commit a0b7526
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 29 deletions.
12 changes: 8 additions & 4 deletions ballista/rust/core/src/serde/logical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,16 +1277,20 @@ impl From<WindowFrameUnits> for protobuf::WindowFrameUnits {
impl TryFrom<WindowFrameBound> for protobuf::WindowFrameBound {
type Error = BallistaError;

fn try_from(bound: WindowFrameBound) -> Result<Self, Self::Error> {
unimplemented!("not implemented")
fn try_from(_bound: WindowFrameBound) -> Result<Self, Self::Error> {
Err(BallistaError::NotImplemented(
"WindowFrameBound => protobuf::WindowFrameBound".to_owned(),
))
}
}

impl TryFrom<WindowFrame> for protobuf::WindowFrame {
type Error = BallistaError;

fn try_from(window: WindowFrame) -> Result<Self, Self::Error> {
unimplemented!("not implemented")
fn try_from(_window: WindowFrame) -> Result<Self, Self::Error> {
Err(BallistaError::NotImplemented(
"WindowFrame => protobuf::WindowFrame".to_owned(),
))
}
}

Expand Down
1 change: 0 additions & 1 deletion ballista/rust/core/src/serde/physical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ impl TryInto<Arc<dyn ExecutionPlan>> for &protobuf::PhysicalPlanNode {
.map(|(expr, name)| expr.try_into().map(|expr| (expr, name.clone())))
.collect::<Result<Vec<_>, _>>()?;

let df_planner = DefaultPhysicalPlanner::default();
let catalog_list =
Arc::new(MemoryCatalogList::new()) as Arc<dyn CatalogList>;
let ctx_state = ExecutionContextState {
Expand Down
1 change: 0 additions & 1 deletion datafusion/src/logical_plan/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use crate::{
datasource::{empty::EmptyTable, parquet::ParquetTable, CsvFile, MemTable},
prelude::CsvReadOptions,
};
use sqlparser::ast::WindowFrame;
use std::collections::HashSet;

/// Builder for logical plans
Expand Down
2 changes: 1 addition & 1 deletion datafusion/src/physical_plan/aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use super::{
functions::Signature,
type_coercion::{coerce, data_types},
Accumulator, AggregateExpr, PhysicalExpr, WindowExpr,
Accumulator, AggregateExpr, PhysicalExpr,
};
use crate::error::{DataFusionError, Result};
use crate::physical_plan::distinct_expressions;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/src/physical_plan/expressions/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::any::Any;
use std::sync::Arc;

use crate::error::Result;
use crate::physical_plan::{Accumulator, AggregateExpr, PhysicalExpr, WindowExpr};
use crate::physical_plan::{Accumulator, AggregateExpr, PhysicalExpr};
use crate::scalar::ScalarValue;
use arrow::compute;
use arrow::datatypes::DataType;
Expand Down
3 changes: 1 addition & 2 deletions datafusion/src/physical_plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use std::sync::Arc;

use super::{
aggregates, cross_join::CrossJoinExec, empty::EmptyExec, expressions::binary,
functions, hash_join::PartitionMode, udaf, union::UnionExec, window_functions,
windows,
functions, hash_join::PartitionMode, udaf, union::UnionExec, windows,
};
use crate::execution::context::ExecutionContextState;
use crate::logical_plan::{
Expand Down
18 changes: 1 addition & 17 deletions datafusion/src/physical_plan/window_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
//! see also https://www.postgresql.org/docs/current/functions-window.html
use crate::error::{DataFusionError, Result};
use crate::execution::context::ExecutionContextState;
use crate::physical_plan::{
aggregates, aggregates::AggregateFunction, functions::Signature,
type_coercion::data_types, PhysicalExpr,
type_coercion::data_types,
};
use arrow::datatypes::DataType;
use arrow::datatypes::{Schema, SchemaRef};
use std::sync::Arc;
use std::{fmt, str::FromStr};

/// WindowFunction
Expand Down Expand Up @@ -150,16 +147,3 @@ fn signature(fun: &WindowFunction) -> Signature {
},
}
}

/// Create a physical (function) expression.
/// This function errors when `args`' can't be coerced to a valid argument type of the function.
pub fn create_physical_expr(
fun: &WindowFunction,
args: &[Arc<dyn PhysicalExpr>],
input_schema: &Schema,
ctx_state: &ExecutionContextState,
) -> Result<Arc<dyn PhysicalExpr>> {
Err(DataFusionError::NotImplemented(format!(
"Physical expr not implemented"
)))
}
4 changes: 2 additions & 2 deletions datafusion/src/physical_plan/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ use crate::physical_plan::{
aggregates, window_functions::WindowFunction, AggregateExpr, Distribution,
ExecutionPlan, Partitioning, PhysicalExpr, SendableRecordBatchStream, WindowExpr,
};
use arrow::datatypes::{DataType, Field, Schema, SchemaRef, TimeUnit};
use arrow::datatypes::{Field, Schema, SchemaRef};
use async_trait::async_trait;
use std::any::Any;
use std::sync::Arc;
use std::{any::Any, pin::Pin};

/// Window execution plan
#[derive(Debug)]
Expand Down

0 comments on commit a0b7526

Please sign in to comment.