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 2021/05/31 18:42:31 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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


   # 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 #458 
   
    # 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.
   -->
   
   No
   
   <!--
   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.

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



[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #459:
URL: https://github.com/apache/arrow-datafusion/pull/459#issuecomment-851638878


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#459](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5eceac7) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/c8ab5a4f00fc8b362eed72d5feb43b03b8ad1fdd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c8ab5a4) will **decrease** coverage by `0.06%`.
   > The diff coverage is `20.58%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/459/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #459      +/-   ##
   ==========================================
   - Coverage   75.30%   75.24%   -0.07%     
   ==========================================
     Files         152      152              
     Lines       25275    25306      +31     
   ==========================================
   + Hits        19033    19041       +8     
   - Misses       6242     6265      +23     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [ballista/rust/core/src/utils.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy91dGlscy5ycw==) | `0.00% <0.00%> (ø)` | |
   | [ballista/rust/executor/src/executor.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9leGVjdXRvci9zcmMvZXhlY3V0b3IucnM=) | `0.00% <0.00%> (ø)` | |
   | [ballista/rust/scheduler/src/lib.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL2xpYi5ycw==) | `20.81% <0.00%> (ø)` | |
   | [...lista/rust/core/src/execution\_plans/query\_stage.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9leGVjdXRpb25fcGxhbnMvcXVlcnlfc3RhZ2UucnM=) | `21.31% <15.55%> (-21.55%)` | :arrow_down: |
   | [ballista/rust/scheduler/src/planner.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL3BsYW5uZXIucnM=) | `68.57% <87.50%> (+0.92%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c8ab5a4...5eceac7](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

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



[GitHub] [arrow-datafusion] andygrove commented on pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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


   @edrevo fyi


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

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



[GitHub] [arrow-datafusion] codecov-commenter edited a comment on pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #459:
URL: https://github.com/apache/arrow-datafusion/pull/459#issuecomment-851638878


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#459](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c6ad3de) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/c8ab5a4f00fc8b362eed72d5feb43b03b8ad1fdd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c8ab5a4) will **increase** coverage by `0.30%`.
   > The diff coverage is `68.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/459/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #459      +/-   ##
   ==========================================
   + Coverage   75.30%   75.60%   +0.30%     
   ==========================================
     Files         152      152              
     Lines       25275    25336      +61     
   ==========================================
   + Hits        19033    19156     +123     
   + Misses       6242     6180      -62     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [ballista/rust/core/src/utils.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy91dGlscy5ycw==) | `27.58% <0.00%> (+27.58%)` | :arrow_up: |
   | [ballista/rust/executor/src/executor.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9leGVjdXRvci9zcmMvZXhlY3V0b3IucnM=) | `0.00% <0.00%> (ø)` | |
   | [ballista/rust/scheduler/src/lib.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL2xpYi5ycw==) | `20.81% <0.00%> (ø)` | |
   | [ballista/rust/scheduler/src/planner.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL3BsYW5uZXIucnM=) | `66.91% <61.53%> (-0.74%)` | :arrow_down: |
   | [...lista/rust/core/src/execution\_plans/query\_stage.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9leGVjdXRpb25fcGxhbnMvcXVlcnlfc3RhZ2UucnM=) | `75.78% <82.27%> (+32.93%)` | :arrow_up: |
   | [ballista/rust/core/src/serde/scheduler/mod.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9zZXJkZS9zY2hlZHVsZXIvbW9kLnJz) | `58.92% <0.00%> (+44.64%)` | :arrow_up: |
   | [ballista/rust/core/src/memory\_stream.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9tZW1vcnlfc3RyZWFtLnJz) | `60.00% <0.00%> (+60.00%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c8ab5a4...c6ad3de](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

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



[GitHub] [arrow-datafusion] alamb merged pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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


   


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

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



[GitHub] [arrow-datafusion] alamb commented on a change in pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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



##########
File path: ballista/rust/core/src/execution_plans/query_stage.rs
##########
@@ -31,26 +45,44 @@ use uuid::Uuid;
 #[derive(Debug, Clone)]
 pub struct QueryStageExec {
     /// Unique ID for the job (query) that this stage is a part of
-    pub job_id: String,
+    job_id: String,
     /// Unique query stage ID within the job
-    pub stage_id: usize,
+    stage_id: usize,
     /// Physical execution plan for this query stage
-    pub child: Arc<dyn ExecutionPlan>,
+    plan: Arc<dyn ExecutionPlan>,
+    /// Path to write output streams to
+    work_dir: String,
+    /// Optional shuffle output partitioning
+    shuffle_output_partitioning: Option<Partitioning>,
 }
 
 impl QueryStageExec {
     /// Create a new query stage
     pub fn try_new(
-        job_id: String,
+        job_id: &str,

Review comment:
       FWIW another pattern that I like is  `job_id: impl Into<String>` so that the caller can pass in an owned String if they have one or a &str if they don't (or anything else that knows how to turn itself into a String) 




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

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



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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



##########
File path: ballista/rust/core/src/execution_plans/query_stage.rs
##########
@@ -31,26 +45,44 @@ use uuid::Uuid;
 #[derive(Debug, Clone)]
 pub struct QueryStageExec {
     /// Unique ID for the job (query) that this stage is a part of
-    pub job_id: String,
+    job_id: String,
     /// Unique query stage ID within the job
-    pub stage_id: usize,
+    stage_id: usize,
     /// Physical execution plan for this query stage
-    pub child: Arc<dyn ExecutionPlan>,
+    plan: Arc<dyn ExecutionPlan>,
+    /// Path to write output streams to
+    work_dir: String,
+    /// Optional shuffle output partitioning
+    shuffle_output_partitioning: Option<Partitioning>,
 }
 
 impl QueryStageExec {
     /// Create a new query stage
     pub fn try_new(
-        job_id: String,
+        job_id: &str,

Review comment:
       FWIW I think for "constructor methods" it is OK to take an owned `String` as the `&str` will be copied anyway.




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

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



[GitHub] [arrow-datafusion] codecov-commenter edited a comment on pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #459:
URL: https://github.com/apache/arrow-datafusion/pull/459#issuecomment-851638878


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#459](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ccdf52b) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/c8ab5a4f00fc8b362eed72d5feb43b03b8ad1fdd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c8ab5a4) will **increase** coverage by `0.31%`.
   > The diff coverage is `68.93%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/459/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #459      +/-   ##
   ==========================================
   + Coverage   75.30%   75.61%   +0.31%     
   ==========================================
     Files         152      152              
     Lines       25275    25330      +55     
   ==========================================
   + Hits        19033    19153     +120     
   + Misses       6242     6177      -65     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [ballista/rust/core/src/utils.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy91dGlscy5ycw==) | `27.58% <0.00%> (+27.58%)` | :arrow_up: |
   | [ballista/rust/executor/src/executor.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9leGVjdXRvci9zcmMvZXhlY3V0b3IucnM=) | `0.00% <0.00%> (ø)` | |
   | [ballista/rust/scheduler/src/lib.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL2xpYi5ycw==) | `20.81% <0.00%> (ø)` | |
   | [ballista/rust/scheduler/src/planner.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9zY2hlZHVsZXIvc3JjL3BsYW5uZXIucnM=) | `66.16% <50.00%> (-1.49%)` | :arrow_down: |
   | [...lista/rust/core/src/execution\_plans/query\_stage.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9leGVjdXRpb25fcGxhbnMvcXVlcnlfc3RhZ2UucnM=) | `78.26% <84.61%> (+35.40%)` | :arrow_up: |
   | [ballista/rust/core/src/serde/scheduler/mod.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9zZXJkZS9zY2hlZHVsZXIvbW9kLnJz) | `58.92% <0.00%> (+44.64%)` | :arrow_up: |
   | [ballista/rust/core/src/memory\_stream.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/459/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmFsbGlzdGEvcnVzdC9jb3JlL3NyYy9tZW1vcnlfc3RyZWFtLnJz) | `60.00% <0.00%> (+60.00%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c8ab5a4...ccdf52b](https://codecov.io/gh/apache/arrow-datafusion/pull/459?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

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



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #459: Refactor QueryStageExec in preparation for implementing map-side shuffle

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



##########
File path: ballista/rust/core/src/execution_plans/query_stage.rs
##########
@@ -77,16 +109,142 @@ impl ExecutionPlan for QueryStageExec {
     ) -> Result<Arc<dyn ExecutionPlan>> {
         assert!(children.len() == 1);
         Ok(Arc::new(QueryStageExec::try_new(
-            self.job_id.clone(),
+            &self.job_id,
             self.stage_id,
             children[0].clone(),
+            &self.work_dir,
+            None,
         )?))
     }
 
     async fn execute(
         &self,
         partition: usize,
     ) -> Result<Pin<Box<dyn RecordBatchStream + Send + Sync>>> {
-        self.child.execute(partition).await
+        let now = Instant::now();
+
+        let mut stream = self.plan.execute(partition).await?;
+
+        let mut path = PathBuf::from(&self.work_dir);
+        path.push(&self.job_id);
+        path.push(&format!("{}", self.stage_id));
+
+        match &self.shuffle_output_partitioning {
+            None => {
+                path.push(&format!("{}", partition));
+                std::fs::create_dir_all(&path)?;
+
+                path.push("data.arrow");
+                let path = path.to_str().unwrap();
+                info!("Writing results to {}", path);
+
+                // stream results to disk
+                let stats = utils::write_stream_to_disk(&mut stream, &path)
+                    .await
+                    .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?;
+
+                info!(
+                    "Executed partition {} in {} seconds. Statistics: {:?}",
+                    partition,
+                    now.elapsed().as_secs(),
+                    stats
+                );
+
+                let schema = Arc::new(Schema::new(vec![
+                    Field::new("path", DataType::Utf8, false),
+                    stats.arrow_struct_repr(),
+                ]));
+
+                // build result set with summary of the partition execution status
+                let mut c0 = StringBuilder::new(1);
+                c0.append_value(&path).unwrap();
+                let path: ArrayRef = Arc::new(c0.finish());
+
+                let stats: ArrayRef = stats
+                    .to_arrow_arrayref()
+                    .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?;
+                let batch = RecordBatch::try_new(schema.clone(), vec![path, stats])
+                    .map_err(DataFusionError::ArrowError)?;
+
+                Ok(Box::pin(MemoryStream::try_new(vec![batch], schema, None)?))
+            }
+
+            Some(Partitioning::Hash(_, _)) => {
+                //TODO re-use code from RepartitionExec to split each batch into
+                // partitions and write to one IPC file per partition
+                // See https://github.com/apache/arrow-datafusion/issues/456
+                unimplemented!()

Review comment:
       Could use `DataFusionError:: NotImplemented`




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

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