Skip to content

feat: Add PlanNode::requiresSingleThread() API (#16753)#16753

Open
mbasmanova wants to merge 1 commit intofacebookincubator:mainfrom
mbasmanova:export-D96366381
Open

feat: Add PlanNode::requiresSingleThread() API (#16753)#16753
mbasmanova wants to merge 1 commit intofacebookincubator:mainfrom
mbasmanova:export-D96366381

Conversation

@mbasmanova
Copy link
Contributor

@mbasmanova mbasmanova commented Mar 12, 2026

Summary:

Add a virtual method to PlanNode that returns true if the node requires
single-threaded execution (maxDrivers = 1). Override in ValuesNode,
ArrowStreamNode, final TopNNode, final LimitNode, final OrderByNode,
LocalMergeNode, MergeExchangeNode, MergeJoinNode, TableWriteMergeNode,
LocalPartitionNode(Gather), MixedUnionNode, null-aware right semi project
HashJoinNode, and TableWriteNode(!supportsMultiThreading).

Refactor LocalPlanner::maxDrivers to use the new API instead of per-type
dynamic_casts for single-thread checks. Config-dependent logic (writer
counts, repartition partition count) remains unchanged.

Reviewed By: xiaoxmeng

Differential Revision: D96366381

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 221050a
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/69b363d9857c000008a4354c

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 12, 2026
@mbasmanova mbasmanova requested a review from xiaoxmeng March 12, 2026 21:11
@meta-codesync
Copy link

meta-codesync bot commented Mar 12, 2026

@mbasmanova has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96366381.

@meta-codesync meta-codesync bot changed the title feat: Add PlanNode::requiresSingleThread() API feat: Add PlanNode::requiresSingleThread() API (#16753) Mar 12, 2026
mbasmanova added a commit to mbasmanova/velox that referenced this pull request Mar 12, 2026
Summary:

Add a virtual method to PlanNode that returns true if the node requires
single-threaded execution (maxDrivers = 1). Override in ValuesNode,
ArrowStreamNode, final TopNNode, final LimitNode, final OrderByNode,
LocalMergeNode, MergeExchangeNode, MergeJoinNode, TableWriteMergeNode,
LocalPartitionNode(Gather), MixedUnionNode, null-aware right semi project
HashJoinNode, and TableWriteNode(!supportsMultiThreading).

Refactor LocalPlanner::maxDrivers to use the new API instead of per-type
dynamic_casts for single-thread checks. Config-dependent logic (writer
counts, repartition partition count) remains unchanged.

Differential Revision: D96366381
mbasmanova added a commit to mbasmanova/velox that referenced this pull request Mar 12, 2026
Summary:
Pull Request resolved: facebookincubator#16753

Add a virtual method to PlanNode that returns true if the node requires
single-threaded execution (maxDrivers = 1). Override in ValuesNode,
ArrowStreamNode, final TopNNode, final LimitNode, final OrderByNode,
LocalMergeNode, MergeExchangeNode, MergeJoinNode, TableWriteMergeNode,
LocalPartitionNode(Gather), MixedUnionNode, null-aware right semi project
HashJoinNode, and TableWriteNode(!supportsMultiThreading).

Refactor LocalPlanner::maxDrivers to use the new API instead of per-type
dynamic_casts for single-thread checks. Config-dependent logic (writer
counts, repartition partition count) remains unchanged.

Differential Revision: D96366381
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@mbasmanova thanks!

Summary:

Add a virtual method to PlanNode that returns true if the node requires
single-threaded execution (maxDrivers = 1). Override in ValuesNode,
ArrowStreamNode, final TopNNode, final LimitNode, final OrderByNode,
LocalMergeNode, MergeExchangeNode, MergeJoinNode, TableWriteMergeNode,
LocalPartitionNode(Gather), MixedUnionNode, null-aware right semi project
HashJoinNode, and TableWriteNode(!supportsMultiThreading).

Refactor LocalPlanner::maxDrivers to use the new API instead of per-type
dynamic_casts for single-thread checks. Config-dependent logic (writer
counts, repartition partition count) remains unchanged.

Reviewed By: xiaoxmeng

Differential Revision: D96366381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants