Skip to content

Add max-union-size-per-datasource Property#37405

Merged
terrymanu merged 1 commit into
apache:masterfrom
wy1433:23635
Dec 17, 2025
Merged

Add max-union-size-per-datasource Property#37405
terrymanu merged 1 commit into
apache:masterfrom
wy1433:23635

Conversation

@wy1433
Copy link
Copy Markdown
Contributor

@wy1433 wy1433 commented Dec 16, 2025

Fixes #23635.

Changes proposed in this pull request:

  • Add max-union-size-per-datasource property to control UNION ALL merge behavior
  • When route units count for a datasource exceeds the threshold, split into batches to restore parallel execution capability
  • Default value is Integer.MAX_VALUE to preserve existing behavior
  • Skip aggregate rewrite when max-union-size-per-datasource = 1 for better performance

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

Copy link
Copy Markdown
Member

@terrymanu terrymanu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Code looks good—max-union-size-per-datasource keeps default behavior, addresses the same-database UNION ALL long-SQL timeout case, and docs/tests are updated. No side effects spotted, so I’m ready to merge. Thanks again and welcome more contributions!

@terrymanu terrymanu merged commit 70bfc9b into apache:master Dec 17, 2025
145 checks passed
@wy1433 wy1433 deleted the 23635 branch December 18, 2025 02:54
makssent pushed a commit to makssent/shardingsphere that referenced this pull request Apr 9, 2026
…ngsphere/master

* remotes/origin/master:
  Add more test cases on CDCDistSQLStatementVisitor (apache#37417)
  Add max-union-size-per-datasource Property (apache#37405)
  Add CDCJobTest and remove unreach codes for CDCJob (apache#37416)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add property to control whether union all same database sql routes

3 participants