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/07/05 19:50:33 UTC

[GitHub] [arrow-datafusion] Dandandan opened a new pull request #683: Introduce (default) number of partitions option, use it in DataFusion

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


   # 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 #661
   
    # 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.  
   -->
   
   Currently we have `concurrency=partitions` which makes sense for good use of parallelism when you can load results of a single partition in memory, but is not what you want in a distributed / big data setting.
   
   # 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.
   -->
   
   This PR adds a new option to DataFusion `partitions` and `with_partitions` that is used for the default number of partitions in a `Hash` or `RoundRobin` repartitioning, or a shuffle in Ballista.
   
   I experimented a bit with setting the number of partitions in Ballista a bit higher, but it seems the writing / reading of small partition has quite a bit of overhead and maybe picking up the tasks in the executors too (?).
   I used a couple of executors too.
   
   # 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.
   -->
   Added members to `ExecutionConfig`.
   
   As the `ExecutionConfig` is public and a member `partitions` has been added it is technically an `api change`
   


-- 
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 a change in pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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



##########
File path: ballista/rust/core/src/utils.rs
##########
@@ -234,7 +234,9 @@ fn build_exec_plan_diagram(
 
 /// Create a DataFusion context that is compatible with Ballista
 pub fn create_datafusion_context() -> ExecutionContext {
-    let config = ExecutionConfig::new().with_concurrency(2); // TODO: this is hack to enable partitioned joins
+    let config = ExecutionConfig::new()
+        .with_concurrency(1)
+        .with_partitions(4); // TODO: make it easier to configure from Ballista

Review comment:
       I filed https://github.com/apache/arrow-datafusion/issues/682 for this

##########
File path: datafusion/src/execution/context.rs
##########
@@ -681,6 +684,14 @@ impl ExecutionConfig {
         self
     }
 
+    /// Customize default number of partitions being used in repartioning
+    pub fn with_partitions(mut self, n: usize) -> Self {

Review comment:
       perhaps `with_default_partitions` would be better?




-- 
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 change in pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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



##########
File path: datafusion/src/execution/context.rs
##########
@@ -639,6 +641,7 @@ impl Default for ExecutionConfig {
     fn default() -> Self {
         Self {
             concurrency: num_cpus::get(),
+            partitions: num_cpus::get(),

Review comment:
       For backwards compatibility what would you think about defaulting `partitions` to `None` and if it was not set using the value for `concurrency` instead? Otherwise users may have to tune two separate knobs when they may just want a big hammer "how many cores should data fusion try and keep busy"




-- 
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 pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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


   Closing as this seems to be superceded by https://github.com/apache/arrow-datafusion/pull/706 -- please reopen if that is not correct


-- 
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 a change in pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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



##########
File path: datafusion/src/execution/context.rs
##########
@@ -681,6 +684,14 @@ impl ExecutionConfig {
         self
     }
 
+    /// Customize default number of partitions being used in repartioning
+    pub fn with_partitions(mut self, n: usize) -> Self {

Review comment:
       perhaps `with_default_partitions` would be better?




-- 
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] Dandandan commented on pull request #683: Introduce (default) number of partitions option, use it in DataFusion

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


   FYI @andygrove 


-- 
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 #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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


   Please take a look at my proposal in https://github.com/apache/arrow-datafusion/pull/706


-- 
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 a change in pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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



##########
File path: ballista/rust/core/src/utils.rs
##########
@@ -234,7 +234,9 @@ fn build_exec_plan_diagram(
 
 /// Create a DataFusion context that is compatible with Ballista
 pub fn create_datafusion_context() -> ExecutionContext {
-    let config = ExecutionConfig::new().with_concurrency(2); // TODO: this is hack to enable partitioned joins
+    let config = ExecutionConfig::new()
+        .with_concurrency(1)
+        .with_partitions(4); // TODO: make it easier to configure from Ballista

Review comment:
       I filed https://github.com/apache/arrow-datafusion/issues/682 for this




-- 
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 closed pull request #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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


   


-- 
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] Dandandan commented on pull request #683: Introduce (default) number of partitions option, use it in DataFusion

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


   FYI @andygrove 


-- 
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 #683: Introduce (default) number of partitions option, use it in DataFusion/Ballista

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


   I spent some more time reviewing the codebase this morning and it appears that we no longer use the `concurrency` config to determine concurrency as in number of threads, but only use it to determine partition counts when repartitioning, so I think we should just rename this field, rather than introduce a new config. Tokio is managing concurrency level automatically.


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