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/05/15 18:00:58 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request, #2537: WIP Remove `scan_csv` methods from `LogicalPlanBuilder`

andygrove opened a new pull request, #2537:
URL: https://github.com/apache/arrow-datafusion/pull/2537

   # 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.
   -->
   
   Part of https://github.com/apache/arrow-datafusion/issues/2536
   
    # 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.  
   -->
   
   - `LogicalPlanBuilder` should be in same crate as `LogicalPlan`
   - `LogicalPlanBuilder` should not need to know about data sources & object store but just `TableSource`
   
   # 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.
   -->
   
   Move some logic from `LogicalPlanBuilder` to `SessionContext`
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   Yes, this changes the `LogicalPlanBuilder` API
   
   <!--
   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] alamb commented on a diff in pull request #2537: Remove `scan_csv` methods from `LogicalPlanBuilder`

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #2537:
URL: https://github.com/apache/arrow-datafusion/pull/2537#discussion_r874139107


##########
ballista/rust/core/src/serde/logical_plan/mod.rs:
##########
@@ -1402,31 +1293,17 @@ mod roundtrip_tests {
 
     #[tokio::test]
     async fn roundtrip_logical_plan() -> Result<()> {
-        let schema = Schema::new(vec![
-            Field::new("id", DataType::Int32, false),
-            Field::new("first_name", DataType::Utf8, false),
-            Field::new("last_name", DataType::Utf8, false),
-            Field::new("state", DataType::Utf8, false),
-            Field::new("salary", DataType::Int32, false),
-        ]);
-
-        let plan = LogicalPlanBuilder::scan_csv(
-            Arc::new(LocalFileSystem {}),
-            "employee.csv",
-            CsvReadOptions::new().schema(&schema).has_header(true),
-            Some(vec![3, 4]),
-            4,
-        )
-        .await
-        .and_then(|plan| plan.aggregate(vec![col("state")], vec![max(col("salary"))]))
-        .and_then(|plan| plan.build())
-        .map_err(BallistaError::DataFusionError)?;
+        let plan = test_scan_csv("employee.csv", Some(vec![3, 4]))
+            .await?
+            .aggregate(vec![col("state")], vec![max(col("salary"))])?
+            .build()?;
 
         roundtrip_test!(plan);
 
         Ok(())
     }
 
+    #[ignore] // see https://github.com/apache/arrow-datafusion/issues/2546

Review Comment:
   FYI other reviewers: https://github.com/apache/arrow-datafusion/issues/2546



##########
ballista/rust/core/src/serde/logical_plan/mod.rs:
##########
@@ -1236,39 +1212,17 @@ mod roundtrip_tests {
 
     #[tokio::test]
     async fn roundtrip_analyze() -> Result<()> {
-        let schema = Schema::new(vec![

Review Comment:
   nice cleanups



-- 
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] andygrove commented on pull request #2537: Remove `scan_csv` methods from `LogicalPlanBuilder`

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #2537:
URL: https://github.com/apache/arrow-datafusion/pull/2537#issuecomment-1128187891

   Thanks for the review @alamb ... I am close to being able to move `LogicalPlanBuilder` to the `datafusion-expr` crate now.


-- 
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] andygrove merged pull request #2537: Remove `scan_csv` methods from `LogicalPlanBuilder`

Posted by GitBox <gi...@apache.org>.
andygrove merged PR #2537:
URL: https://github.com/apache/arrow-datafusion/pull/2537


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