Skip to content

Conversation

@gabotechs
Copy link
Collaborator

Will playing with the current API, I'm finding it useful to be able to traverse a distributed plan and see, for each NetworkBoundary, how many tasks it receives as an input.

The main use case for this right now is for letting people decide how many tasks will be spawned in a network boundary as a function as the input tasks of another network boundary, for example:

               ┌────────────────────┐             
               │NetworkCoalesceExec │             
               │  max(10, 5) tasks  │             
               └────────────────────┘             
                          │                       
           ┌──────────────┴────────────┐          
           ▼                           ▼          
┌────────────────────┐      ┌────────────────────┐
│ NetworkShuffleExec │      │NetworkCoalesceExec │
│      10 tasks      │      │      5 tasks       │
└────────────────────┘      └────────────────────┘

If I want to be able to do that in the upper network boundary, I need to be able to access how many input tasks the lower network boundaries are spawning

Copy link
Collaborator

@NGA-TRAN NGA-TRAN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concept looks good. The API is fine and we will need it for special use cases.

We have to be careful with the usage and may need to add document because it will be complicated if we want to shuffle to different number of tasks (see your NetworkCoalesceExec that needs max(10, 5) ). Usually, in optimal plan we do not do it except in some special cases. People use this have to know exactly what they are doing.

I suggest we play with this in real examples and document it so it won't be abuse. I actually have a use case for this but it will take me a wile to show it

@gabotechs gabotechs merged commit a2dd7ee into main Oct 27, 2025
4 checks passed
@gabotechs gabotechs deleted the gabrielmusat/return-input-task-count branch October 27, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants