You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FlyingZC (via GitHub)" <gi...@apache.org> on 2026/06/04 04:05:04 UTC
[PR] Optimize SQL rewrite token traversal [shardingsphere]
FlyingZC opened a new pull request, #38796:
URL: https://github.com/apache/shardingsphere/pull/38796
Fixes #ISSUSE_ID.
Changes proposed in this pull request:
-
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) 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](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Optimize SQL rewrite token traversal [shardingsphere]
Posted by "FlyingZC (via GitHub)" <gi...@apache.org>.
FlyingZC commented on PR #38796:
URL: https://github.com/apache/shardingsphere/pull/38796#issuecomment-4619163423
### Decision
- **Merge Verdict: Mergeable**
- **Reviewed Scope:** PR #38794 latest head `d17cbba0b5e05ff47890060f53653ecc73ce7c43`, merge-base `908ff08cea2925d387983f42580c5fc493fe3228`; local diff file list matched GitHub `/
pulls/38794/files`. Reviewed `features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java`, `infra/executor/src/main/java/org/apache/shardingsphere/
infra/executor/sql/prepare/driver/DriverExecutionPrepareEngine.java`, and `infra/route/core/src/main/java/org/apache/shardingsphere/infra/route/context/RouteUnit.java`.
- **Not Reviewed Scope:** GitHub Actions / CI status and full repository build.
- **Need Expert Review:** No.
### Basis
- `features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java:309` simplifies `containsKey` + `get` into one null-aware lookup. Existing missing-table
and null-table-name behavior is preserved by the existing rule tests.
- `infra/route/core/src/main/java/org/apache/shardingsphere/infra/route/context/RouteUnit.java:85` hoists the datasource mismatch check before scanning table mappers. This keeps the same
datasource-first matching semantics and avoids repeated invariant checks inside the loop.
- `infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/prepare/driver/DriverExecutionPrepareEngine.java:97` and `infra/executor/src/main/java/org/apache/
shardingsphere/infra/executor/sql/prepare/driver/DriverExecutionPrepareEngine.java:109` use pre-sized `ArrayList` for append-only lists whose target sizes are already known. Order and
`ExecutionGroup` behavior are unchanged.
### Verification
- `git diff --name-status $(git merge-base upstream/master upstream/pr/38794)..upstream/pr/38794` matched the GitHub file list.
- `git diff --check $(git merge-base upstream/master upstream/pr/38794)..upstream/pr/38794` passed with exit code 0.
- `./mvnw -pl infra/route/core,features/sharding/core,infra/executor -am -DskipITs -Dspotless.skip=true -Dcheckstyle.skip=true -Dsurefire.failIfNoSpecifiedTests=false
-Dtest=RouteUnitTest,RouteContextTest,ShardingRuleTest test` passed with exit code 0.
- Surefire confirmed `RouteUnitTest` 6 tests, `RouteContextTest` 11 tests, and `ShardingRuleTest` 71 tests passed with 0 failures/errors/skips.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Optimize SQL rewrite token traversal [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu merged PR #38796:
URL: https://github.com/apache/shardingsphere/pull/38796
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org