@@ -87,13 +87,7 @@ impl DataFrame {
8787 }
8888
8989 /// Create a physical plan
90- pub async fn create_physical_plan ( mut self ) -> Result < Arc < dyn ExecutionPlan > > {
91- self . create_physical_plan_impl ( ) . await
92- }
93-
94- /// Temporary pending #4626
95- async fn create_physical_plan_impl ( & mut self ) -> Result < Arc < dyn ExecutionPlan > > {
96- self . session_state . execution_props . start_execution ( ) ;
90+ pub async fn create_physical_plan ( self ) -> Result < Arc < dyn ExecutionPlan > > {
9791 self . session_state . create_physical_plan ( & self . plan ) . await
9892 }
9993
@@ -627,24 +621,24 @@ impl DataFrame {
627621 }
628622
629623 /// Write a `DataFrame` to a CSV file.
630- pub async fn write_csv ( mut self , path : & str ) -> Result < ( ) > {
631- let plan = self . create_physical_plan_impl ( ) . await ?;
624+ pub async fn write_csv ( self , path : & str ) -> Result < ( ) > {
625+ let plan = self . session_state . create_physical_plan ( & self . plan ) . await ?;
632626 plan_to_csv ( & self . session_state , plan, path) . await
633627 }
634628
635629 /// Write a `DataFrame` to a Parquet file.
636630 pub async fn write_parquet (
637- mut self ,
631+ self ,
638632 path : & str ,
639633 writer_properties : Option < WriterProperties > ,
640634 ) -> Result < ( ) > {
641- let plan = self . create_physical_plan_impl ( ) . await ?;
635+ let plan = self . session_state . create_physical_plan ( & self . plan ) . await ?;
642636 plan_to_parquet ( & self . session_state , plan, path, writer_properties) . await
643637 }
644638
645639 /// Executes a query and writes the results to a partitioned JSON file.
646- pub async fn write_json ( mut self , path : impl AsRef < str > ) -> Result < ( ) > {
647- let plan = self . create_physical_plan_impl ( ) . await ?;
640+ pub async fn write_json ( self , path : impl AsRef < str > ) -> Result < ( ) > {
641+ let plan = self . session_state . create_physical_plan ( & self . plan ) . await ?;
648642 plan_to_json ( & self . session_state , plan, path) . await
649643 }
650644
0 commit comments