Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit test works
Browse files Browse the repository at this point in the history
andygrove committed Sep 7, 2019
1 parent a292cce commit 5515033
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rust/datafusion/src/execution/context.rs
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ use crate::execution::filter::FilterRelation;
use crate::execution::limit::LimitRelation;
use crate::execution::physical_plan::datasource::DatasourceExec;
use crate::execution::physical_plan::projection::ProjectionExec;
use crate::execution::physical_plan::expressions::Column;
use crate::execution::physical_plan::{ExecutionPlan, PhysicalExpr};
use crate::execution::projection::ProjectRelation;
use crate::execution::relation::{DataSourceRelation, Relation};
@@ -261,11 +262,14 @@ impl ExecutionContext {
/// Create a physical expression from a logical expression
pub fn create_physical_expr(
&self,
_e: &Expr,
e: &Expr,
_input_schema: &Schema,
) -> Result<Arc<dyn PhysicalExpr>> {
//TODO: implement this next
unimplemented!()

match e {
Expr::Column(i) => Ok(Arc::new(Column::new(*i))),
_ => Err(ExecutionError::NotImplemented("Unsupported expression".to_string()))
}
}

/// Execute a physical plan and collect the results in memory
@@ -545,7 +549,8 @@ mod tests {

let results = ctx.collect(physical_plan.as_ref())?;

assert_eq!(123, results.len());
assert_eq!(1, results.len());
assert_eq!(2, results[0].num_columns());

Ok(())
}

0 comments on commit 5515033

Please sign in to comment.