You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ClaireLytt (via GitHub)" <gi...@apache.org> on 2026/09/27 07:10:50 UTC
[PR] Add OPENQUERY utility helpers for linked-server encrypt rewrite infrastructure [shardingsphere]
ClaireLytt opened a new pull request, #39977:
URL: https://github.com/apache/shardingsphere/pull/39977
For #39313.
This is the first of a planned four-part series that splits PR #39786 (the full linked-server infrastructure module) into smaller, independently reviewable units. The split was chosen to keep each PR focused and easy to review.
### This PR (1/4): OPENQUERY utility helpers
Adds the `kernel/linked-server` module skeleton and `OpenQueryUtils`, a zero-dependency utility class for OPENQUERY AST detection, extraction, and T-SQL escaping. This class has no dependency on any other linked-server code and can be reviewed in isolation.
**Contents:**
- Module skeleton: `kernel/linked-server/pom.xml`, `kernel/linked-server/core/pom.xml`, `kernel/pom.xml` update
- `OpenQueryUtils` — four static helpers:
- `isOpenQuery()`: detect OPENQUERY function table segments
- `extractLinkedServerName()`: extract server name (supports `[bracket]`, `"double-quote"`, and bare identifiers)
- `extractInnerSQLSegment()`: extract the inner SQL literal
- `decodeTSqlEscaping()` / `encodeTSqlEscaping()`: T-SQL `''` ↔ `'` conversion
- `OpenQueryUtilsTest` — 17 focused unit tests covering all methods, identifier quoting styles, edge cases, and round-trip escaping
### Planned follow-up PRs
| PR | Scope | Depends on |
| ---- | ------------------------------------------------------------ | ---------- |
| 2/4 | API module: `LinkedServerConfiguration` (with delimited-identifier-aware three-part identity parsing), `LinkedServerRuleConfiguration` | This PR |
| 3/4 | Core rule + SPI loading: `LinkedServerTable`, `LinkedServerRule`, `LinkedServerRuleBuilder`, `LinkedServerTableMapperRuleAttribute`, `LinkedServerOrder` | PR 2/4 |
| 4/4 | YAML persistence + packaging: YAML config classes, `YamlLinkedServerRuleConfigurationSwapper`, SPI descriptors, JDBC/Proxy POM wiring, RELEASE-NOTES | PR 3/4 |
After all four parts merge, the linked-server infrastructure will be complete and ready for the Encrypt integration PR that implements the actual OPENQUERY rewrite using the shared SQL Server parser (as agreed in the #39313 design contract).
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [x] 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.
- [x] 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/)
- [x] I have disclosed the tool and affected files or scope for any material AI assistance, as required by the [AI-assisted contribution policy].
**AI Disclosure:** Claude Code assisted with code review analysis, review comment summarization, and drafting the PR description. All production and test code was written and reviewed by the contributor.
[AI-assisted contribution policy]: https://github.com/apache/shardingsphere/blob/master/AI_POLICY.md
--
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] Add OPENQUERY utility helpers for linked-server encrypt rewrite infrastructure [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed pull request #39977: Add OPENQUERY utility helpers for linked-server encrypt rewrite infrastructure
URL: https://github.com/apache/shardingsphere/pull/39977
--
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