pub async fn to_field_list(&self, plan: FieldListPlan) -> Result<FieldList> {
        let FieldListPlan { plans } = plan;

        // Run the plans in parallel
        let handles = plans
            .into_iter()
            .map(|plan| {
                let executor_type = ExecutorType::Query;
                let ctx = self.new_context(executor_type);
                self.run(
                    async move {
                        let physical_plan = ctx
                            .prepare_plan(&plan)
                            .context(DataFusionPhysicalPlanning)?;

                        // TODO: avoid this buffering
                        let fieldlist = ctx
                            .collect(physical_plan)
                            .await
                            .context(FieldListExectuor)?
                            .into_fieldlist()
                            .context(FieldListConversion);

                        Ok(fieldlist)
                    },
                    executor_type,
                )
            })
            .collect::<Vec<_>>();

        // collect them all up and combine them
        let mut results = Vec::new();
        for join_handle in handles {
            let fieldlist = join_handle.await???;

            results.push(fieldlist);
        }

        results.into_fieldlist().context(FieldListConversion)
    }
/// Executes `plan` and return the resulting FieldList on the query executor
Executes `plan` and return the resulting FieldList on the query executor
Executes ` plan ` and return the resulting FieldList on the query executor
pub async fn to_field_list(&self, plan: FieldListPlan) -> Result<FieldList> {
        let FieldListPlan { plans } = plan;
        // Run the plans in parallel
        let handles = plans
            .into_iter()
            .map(|plan| {
                let executor_type = ExecutorType::Query;
                let ctx = self.new_context(executor_type);
                self.run(
                    async move {
                        let physical_plan = ctx
                            .prepare_plan(&plan)
                            .context(DataFusionPhysicalPlanning)?;
                        // TODO: avoid this buffering
                        let fieldlist = ctx
                            .collect(physical_plan)
                            .await
                            .context(FieldListExectuor)?
                            .into_fieldlist()
                            .context(FieldListConversion);
                        Ok(fieldlist)
                    },
                    executor_type,
                )
            })
            .collect::<Vec<_>>();
        // collect them all up and combine them
        let mut results = Vec::new();
        for join_handle in handles {
            let fieldlist = join_handle.await???;
            results.push(fieldlist);
        }
        results.into_fieldlist().context(FieldListConversion)
    }
pub async fn to_field_list ( & self , plan : FieldListPlan ) -> Result < FieldList > { let FieldListPlan { plans } = plan ; // Run the plans in parallel let handles = plans . into_iter ( ) . map ( | plan | { let executor_type = ExecutorType :: Query ; let ctx = self . new_context ( executor_type ) ; self . run ( async move { let physical_plan = ctx . prepare_plan ( & plan ) . context ( DataFusionPhysicalPlanning ) ? ; // TODO: avoid this buffering let fieldlist = ctx . collect ( physical_plan ) . await . context ( FieldListExectuor ) ? . into_fieldlist ( ) . context ( FieldListConversion ) ; Ok ( fieldlist ) } , executor_type , ) } ) . collect :: < Vec < _ > > ( ) ; // collect them all up and combine them let mut results = Vec :: new ( ) ; for join_handle in handles { let fieldlist = join_handle . await ? ? ? ; results . push ( fieldlist ) ; } results . into_fieldlist ( ) . context ( FieldListConversion ) }
Executes `plan` and return the resulting FieldList on the query executor
Executes ` plan ` and return the resulting FieldList on the query executor
&self
plan
FieldListPlan
&self
plan
FieldListPlan