xudong963 commented on a change in pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#discussion_r825381688



##########
File path: datafusion/src/dataframe.rs
##########
@@ -229,25 +325,28 @@ pub trait DataFrame: Send + Sync {
     /// # Ok(())
     /// # }
     /// ```
-    fn repartition(
+    pub fn repartition(
         &self,
         partitioning_scheme: Partitioning,
-    ) -> Result<Arc<dyn DataFrame>>;
+    ) -> Result<Arc<DataFrame>> {
+        let plan = LogicalPlanBuilder::from(self.to_logical_plan())
+            .repartition(partitioning_scheme)?
+            .build()?;
+        Ok(Arc::new(DataFrame::new(self.ctx_state.clone(), &plan)))
+    }
 
-    /// Executes this DataFrame and collects all results into a vector of 
RecordBatch.
-    ///
-    /// ```
-    /// # use datafusion::prelude::*;
-    /// # use datafusion::error::Result;
-    /// # #[tokio::main]
-    /// # async fn main() -> Result<()> {
-    /// let mut ctx = ExecutionContext::new();
-    /// let df = ctx.read_csv("tests/example.csv", 
CsvReadOptions::new()).await?;
-    /// let batches = df.collect().await?;
-    /// # Ok(())
-    /// # }
-    /// ```

Review comment:
       How about remaining the annotation?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to