@@ -30,7 +30,7 @@ use crate::{error::BallistaError, serde::scheduler::Action as BallistaAction};
3030
3131use datafusion:: logical_plan:: plan:: Extension ;
3232use datafusion:: physical_plan:: ExecutionPlan ;
33- use datafusion:: prelude:: ExecutionContext ;
33+ use datafusion:: prelude:: SessionContext ;
3434use prost:: Message ;
3535
3636// include the generated protobuf source as a submodule
@@ -67,7 +67,7 @@ pub trait AsLogicalPlan: Debug + Send + Sync + Clone {
6767
6868 fn try_into_logical_plan (
6969 & self ,
70- ctx : & ExecutionContext ,
70+ ctx : & SessionContext ,
7171 extension_codec : & dyn LogicalExtensionCodec ,
7272 ) -> Result < LogicalPlan , BallistaError > ;
7373
@@ -130,7 +130,7 @@ pub trait AsExecutionPlan: Debug + Send + Sync + Clone {
130130
131131 fn try_into_physical_plan (
132132 & self ,
133- ctx : & ExecutionContext ,
133+ ctx : & SessionContext ,
134134 extension_codec : & dyn PhysicalExtensionCodec ,
135135 ) -> Result < Arc < dyn ExecutionPlan > , BallistaError > ;
136136
@@ -345,8 +345,7 @@ mod tests {
345345 use datafusion:: arrow:: datatypes:: SchemaRef ;
346346 use datafusion:: datasource:: object_store:: local:: LocalFileSystem ;
347347 use datafusion:: error:: DataFusionError ;
348- use datafusion:: execution:: context:: { ExecutionContextState , QueryPlanner } ;
349- use datafusion:: execution:: runtime_env:: RuntimeEnv ;
348+ use datafusion:: execution:: context:: { QueryPlanner , SessionState , TaskContext } ;
350349 use datafusion:: logical_plan:: plan:: Extension ;
351350 use datafusion:: logical_plan:: {
352351 col, DFSchemaRef , Expr , LogicalPlan , LogicalPlanBuilder , UserDefinedLogicalNode ,
@@ -357,7 +356,7 @@ mod tests {
357356 DisplayFormatType , Distribution , ExecutionPlan , Partitioning , PhysicalPlanner ,
358357 SendableRecordBatchStream , Statistics ,
359358 } ;
360- use datafusion:: prelude:: { CsvReadOptions , ExecutionConfig , ExecutionContext } ;
359+ use datafusion:: prelude:: { CsvReadOptions , SessionConfig , SessionContext } ;
361360 use prost:: Message ;
362361 use std:: any:: Any ;
363362
@@ -512,7 +511,7 @@ mod tests {
512511 async fn execute (
513512 & self ,
514513 _partition : usize ,
515- _runtime : Arc < RuntimeEnv > ,
514+ _context : Arc < TaskContext > ,
516515 ) -> datafusion:: error:: Result < SendableRecordBatchStream > {
517516 Err ( DataFusionError :: NotImplemented (
518517 "not implemented" . to_string ( ) ,
@@ -548,7 +547,7 @@ mod tests {
548547 node : & dyn UserDefinedLogicalNode ,
549548 logical_inputs : & [ & LogicalPlan ] ,
550549 physical_inputs : & [ Arc < dyn ExecutionPlan > ] ,
551- _ctx_state : & ExecutionContextState ,
550+ _session_state : & SessionState ,
552551 ) -> datafusion:: error:: Result < Option < Arc < dyn ExecutionPlan > > > {
553552 Ok (
554553 if let Some ( topk_node) = node. as_any ( ) . downcast_ref :: < TopKPlanNode > ( ) {
@@ -575,7 +574,7 @@ mod tests {
575574 async fn create_physical_plan (
576575 & self ,
577576 logical_plan : & LogicalPlan ,
578- ctx_state : & ExecutionContextState ,
577+ session_state : & SessionState ,
579578 ) -> datafusion:: error:: Result < Arc < dyn ExecutionPlan > > {
580579 // Teach the default physical planner how to plan TopK nodes.
581580 let physical_planner =
@@ -584,7 +583,7 @@ mod tests {
584583 ) ] ) ;
585584 // Delegate most work of physical planning to the default physical planner
586585 physical_planner
587- . create_physical_plan ( logical_plan, ctx_state )
586+ . create_physical_plan ( logical_plan, session_state )
588587 . await
589588 }
590589 }
@@ -694,9 +693,9 @@ mod tests {
694693 async fn test_extension_plan ( ) -> crate :: error:: Result < ( ) > {
695694 let store = Arc :: new ( LocalFileSystem { } ) ;
696695 let config =
697- ExecutionConfig :: new ( ) . with_query_planner ( Arc :: new ( TopKQueryPlanner { } ) ) ;
696+ SessionConfig :: new ( ) . with_query_planner ( Arc :: new ( TopKQueryPlanner { } ) ) ;
698697
699- let ctx = ExecutionContext :: with_config ( config) ;
698+ let ctx = SessionContext :: with_config ( config) ;
700699
701700 let scan = LogicalPlanBuilder :: scan_csv (
702701 store,
0 commit comments