/// Write the given `rec_batch` as a parquet file then make it into an exec plan
Write the given `rec_batch` as a parquet file then make it into an exec plan
Write the given ` rec_batch ` as a parquet file then make it into an exec plan
async fn write_and_exec(rec_batch: &RecordBatch, filename: &str) -> Vec<RecordBatch> {
        let (tmp_file, path) = get_temp_file(filename);
        let mut writer =
            ArrowWriter::try_new(tmp_file.try_clone().unwrap(), rec_batch.schema(), None)
                .unwrap();
        writer.write(&rec_batch).unwrap();
        writer.close().unwrap();
        let file = CachedFile::new(
            path.into_os_string().into_string().unwrap(),
            tmp_file.metadata().unwrap().len(),
            Arc::new(RangeCache::new().await),
            "file_downloader".to_owned(),
            || Arc::new(FileDownloader {}),
        );
        let exec_plan = ParquetExec::new(vec![file], None, 2048, rec_batch.schema());
        datafusion::physical_plan::collect(Arc::new(exec_plan))
            .await
            .unwrap()
    }
async fn write_and_exec ( rec_batch : & RecordBatch , filename : & str ) -> Vec < RecordBatch > { let ( tmp_file , path ) = get_temp_file ( filename ) ; let mut writer = ArrowWriter :: try_new ( tmp_file . try_clone ( ) . unwrap ( ) , rec_batch . schema ( ) , None ) . unwrap ( ) ; writer . write ( & rec_batch ) . unwrap ( ) ; writer . close ( ) . unwrap ( ) ; let file = CachedFile :: new ( path . into_os_string ( ) . into_string ( ) . unwrap ( ) , tmp_file . metadata ( ) . unwrap ( ) . len ( ) , Arc :: new ( RangeCache :: new ( ) . await ) , " " . to_owned ( ) , | | Arc :: new ( FileDownloader { } ) , ) ; let exec_plan = ParquetExec :: new ( vec ! [ file ] , None , 2048 , rec_batch . schema ( ) ) ; datafusion :: physical_plan :: collect ( Arc :: new ( exec_plan ) ) . await . unwrap ( ) }
Write the given `rec_batch` as a parquet file then make it into an exec plan
Write the given ` rec_batch ` as a parquet file then make it into an exec plan
rec_batch
&RecordBatch
filename
&str