You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/13 04:03:41 UTC

[GitHub] [arrow-datafusion] xudong963 commented on a change in pull request #1998: Merge dataframe and dataframe imp

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org