11use std:: sync:: Arc ;
22
33use anyhow:: anyhow;
4- use arrow:: datatypes:: SchemaRef ;
4+ use arrow:: datatypes:: { DataType , Field , Schema , SchemaRef } ;
55use datafusion:: {
66 logical_expr:: LogicalPlan , physical_plan:: ExecutionPlan , prelude:: SessionContext ,
77} ;
88use datafusion_substrait:: logical_plan:: consumer:: from_substrait_plan;
9+ use datafusion_substrait:: substrait:: proto:: Plan ;
910
1011use crate :: {
1112 explain:: { is_explain_query, DistributedExplainExec } ,
@@ -131,10 +132,7 @@ impl QueryPlanner {
131132 }
132133
133134 /// Prepare a distributed query (Substrait entry point)
134- pub async fn prepare_substrait_query (
135- & self ,
136- substrait_plan : datafusion_substrait:: substrait:: proto:: Plan ,
137- ) -> Result < QueryPlan > {
135+ pub async fn prepare_substrait_query ( & self , substrait_plan : Plan ) -> Result < QueryPlan > {
138136 let base_result = self
139137 . prepare_substrait_query_base ( substrait_plan, "SUBSTRAIT" )
140138 . await ?;
@@ -143,7 +141,7 @@ impl QueryPlanner {
143141
144142 pub async fn prepare_substrait_query_base (
145143 & self ,
146- substrait_plan : datafusion_substrait :: substrait :: proto :: Plan ,
144+ substrait_plan : Plan ,
147145 query_type : & str ,
148146 ) -> Result < QueryPlanBase > {
149147 debug ! (
@@ -219,7 +217,6 @@ impl QueryPlanner {
219217 ) ;
220218
221219 // create the schema for EXPLAIN results
222- use arrow:: datatypes:: { DataType , Field , Schema } ;
223220 let schema = Arc :: new ( Schema :: new ( vec ! [
224221 Field :: new( "plan_type" , DataType :: Utf8 , false ) ,
225222 Field :: new( "plan" , DataType :: Utf8 , false ) ,
0 commit comments