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/12 22:11:13 UTC

[GitHub] [arrow-datafusion] vchag opened a new pull request #1998: Merge dataframe and dataframe imp

vchag opened a new pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998


   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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



[GitHub] [arrow-datafusion] vchag commented on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
vchag commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1066431433


   > LGTM, thank you @vchag
   > 
   > Btw, some examples in `datafusion-examples/examples` still use dataframe impl.
   
   You're welcome @xudong963 
   Thanks for pointing it out. 
   
   The log mentions of an 
   unresolved import `datafusion::execution::dataframe_impl` 
   in  datafusion-examples/examples/custom_datasource.rs:24:28
   
   `datafusion-examples/examples/custom_datasource.rs` isn't present in 
   datafusion-examples.
   
   Could the build process be using an old version of datafusion-examples module?
   
   


-- 
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



[GitHub] [arrow-datafusion] yjshen merged pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
yjshen merged pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998


   


-- 
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



[GitHub] [arrow-datafusion] vchag commented on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
vchag commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1068344454


   > Thanks @vchag @xudong963 !
   
   yw!


-- 
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



[GitHub] [arrow-datafusion] xudong963 edited a comment on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
xudong963 edited a comment on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1066717082


   > `datafusion-examples/examples/custom_datasource.rs` isn't present in
   > datafusion-examples.
   
   It exists in master
   <img width="1090" alt="image" src="https://user-images.githubusercontent.com/41979257/158170065-c5e347ab-47b7-4d1e-8f67-4a9b47484c2b.png">
   
   
   However, the ticket didn't delete it
   <img width="458" alt="image" src="https://user-images.githubusercontent.com/41979257/158170261-c87df7a1-eb26-4cb3-bf33-2506701b8b67.png">
   
   strange...


-- 
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



[GitHub] [arrow-datafusion] vchag commented on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
vchag commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1067333014


   > > `datafusion-examples/examples/custom_datasource.rs` isn't present in
   > > datafusion-examples.
   > 
   > It exists in master <img alt="image" width="1090" src="https://user-images.githubusercontent.com/41979257/158170065-c5e347ab-47b7-4d1e-8f67-4a9b47484c2b.png">
   > 
   > However, the ticket didn't delete it <img alt="image" width="458" src="https://user-images.githubusercontent.com/41979257/158170261-c87df7a1-eb26-4cb3-bf33-2506701b8b67.png">
   > 
   > strange...
   
   Sorry, my bad. My branch was lagging. Merging apache: master into my branch fixed the issue.   
    


-- 
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



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

Posted by GitBox <gi...@apache.org>.
xudong963 commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1066717082


   > `datafusion-examples/examples/custom_datasource.rs` isn't present in
   > datafusion-examples.
   
   It exists in master
   <img width="1090" alt="image" src="https://user-images.githubusercontent.com/41979257/158170065-c5e347ab-47b7-4d1e-8f67-4a9b47484c2b.png">
   
   
   However, the ticket didn't delete it
   <img width="458" alt="image" src="https://user-images.githubusercontent.com/41979257/158170261-c87df7a1-eb26-4cb3-bf33-2506701b8b67.png">
   


-- 
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



[GitHub] [arrow-datafusion] houqp commented on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
houqp commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1070323810


   nice work @vchag !


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
vchag commented on a change in pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#discussion_r825639132



##########
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:
       Surething, revised the dataframe.rs files as suggested.  
   




-- 
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



[GitHub] [arrow-datafusion] yjshen commented on pull request #1998: Merge dataframe and dataframe imp

Posted by GitBox <gi...@apache.org>.
yjshen commented on pull request #1998:
URL: https://github.com/apache/arrow-datafusion/pull/1998#issuecomment-1067616969


   Thanks @vchag @xudong963 !


-- 
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