You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/28 06:25:16 UTC
[GitHub] [shardingsphere] azexcy opened a new pull request, #22475: Pipeline SQL builder add reserved metadata, only quote reserved words
azexcy opened a new pull request, #22475:
URL: https://github.com/apache/shardingsphere/pull/22475
Changes proposed in this pull request:
- Pipeline SQL builder add reserved metadata, only quote reserved words
- Add unit test
---
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.
--
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
[GitHub] [shardingsphere] sandynz commented on a diff in pull request #22475: Pipeline SQL builder add reserved metadata, only quote reserved words
Posted by GitBox <gi...@apache.org>.
sandynz commented on code in PR #22475:
URL: https://github.com/apache/shardingsphere/pull/22475#discussion_r1033196872
##########
kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/sqlbuilder/MySQLPipelineSQLBuilderTest.java:
##########
@@ -61,4 +61,20 @@ private DataRecord mockDataRecord(final String tableName) {
result.addColumn(new Column("c3", "", true, false));
return result;
}
+
+ @Test
+ public void assertQuoteKeyword() {
+ String tableName = "CASCADE";
+ String actualCountSql = sqlBuilder.buildCountSQL(null, tableName);
+ assertThat(actualCountSql, is(String.format("SELECT COUNT(*) FROM %s", sqlBuilder.quote(tableName))));
+ actualCountSql = sqlBuilder.buildCountSQL(null, tableName.toLowerCase());
+ assertThat(actualCountSql, is(String.format("SELECT COUNT(*) FROM %s", sqlBuilder.quote(tableName.toLowerCase()))));
+ }
+
+ @Test
+ public void assertQuoteNormal() {
Review Comment:
1, Method name `assertQuoteNormal` could be improved, there's no `quoted` in SQL.
2, Could we simplify `expectedDropSQL`, `String.format` is not necessary.
And also in other implementations.
--
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
[GitHub] [shardingsphere] codecov-commenter commented on pull request #22475: Pipeline SQL builder add reserved metadata, only quote reserved words
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #22475:
URL: https://github.com/apache/shardingsphere/pull/22475#issuecomment-1328639861
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/22475?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#22475](https://codecov.io/gh/apache/shardingsphere/pull/22475?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e6b767b) into [master](https://codecov.io/gh/apache/shardingsphere/commit/38f7e459c83144a8c0c72e5e885ec1d32df693ce?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (38f7e45) will **increase** coverage by `0.01%`.
> The diff coverage is `75.00%`.
> :exclamation: Current head e6b767b differs from pull request most recent head dd94193. Consider uploading reports for the commit dd94193 to get more accurate results
```diff
@@ Coverage Diff @@
## master #22475 +/- ##
============================================
+ Coverage 51.05% 51.07% +0.01%
Complexity 2512 2512
============================================
Files 4179 4179
Lines 58109 58124 +15
Branches 9891 9891
============================================
+ Hits 29670 29684 +14
- Misses 25911 25912 +1
Partials 2528 2528
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/22475?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ne/core/sqlbuilder/AbstractPipelineSQLBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/22475/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9jb3JlL3NxbGJ1aWxkZXIvQWJzdHJhY3RQaXBlbGluZVNRTEJ1aWxkZXIuamF2YQ==) | `3.27% <0.00%> (ø)` | |
| [...ine/core/sqlbuilder/DefaultPipelineSQLBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/22475/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9jb3JlL3NxbGJ1aWxkZXIvRGVmYXVsdFBpcGVsaW5lU1FMQnVpbGRlci5qYXZh) | `20.00% <0.00%> (-30.00%)` | :arrow_down: |
| [...line/mysql/sqlbuilder/MySQLPipelineSQLBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/22475/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9teXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZGF0YS9waXBlbGluZS9teXNxbC9zcWxidWlsZGVyL015U1FMUGlwZWxpbmVTUUxCdWlsZGVyLmphdmE=) | `88.88% <100.00%> (+3.17%)` | :arrow_up: |
| [...ngauss/sqlbuilder/OpenGaussPipelineSQLBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/22475/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9vcGVuZ2F1c3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RhdGEvcGlwZWxpbmUvb3BlbmdhdXNzL3NxbGJ1aWxkZXIvT3BlbkdhdXNzUGlwZWxpbmVTUUxCdWlsZGVyLmphdmE=) | `94.11% <100.00%> (+9.50%)` | :arrow_up: |
| [...resql/sqlbuilder/PostgreSQLPipelineSQLBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/22475/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a2VybmVsL2RhdGEtcGlwZWxpbmUvZGlhbGVjdC9wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL3Bvc3RncmVzcWwvc3FsYnVpbGRlci9Qb3N0Z3JlU1FMUGlwZWxpbmVTUUxCdWlsZGVyLmphdmE=) | `100.00% <100.00%> (+5.88%)` | :arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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
[GitHub] [shardingsphere] sandynz merged pull request #22475: Pipeline SQL builder add reserved metadata, only quote reserved words
Posted by GitBox <gi...@apache.org>.
sandynz merged PR #22475:
URL: https://github.com/apache/shardingsphere/pull/22475
--
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