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/08/03 14:17:15 UTC
[GitHub] [shardingsphere] everly-gif opened a new pull request, #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
everly-gif opened a new pull request, #19842:
URL: https://github.com/apache/shardingsphere/pull/19842
Ref #17848 .
Sub-issue of #14015
Changes proposed in this pull request:
- Proofread `ALTER STATISTICS` grammar
- Support parsing `ALTER STATISTICS` in PostgreSQL
- Add tests
✅ Builds locally
--
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] strongduanmu commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937314296
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
> it doesn't exsits in the PostgreSQL dialect here https://www.postgresql.org/docs/current/sql-alterstatistics.html
Can you check this grammar in PostgreSQL source code?
--
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 #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#issuecomment-1204112612
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/19842?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 [#19842](https://codecov.io/gh/apache/shardingsphere/pull/19842?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bf60841) into [master](https://codecov.io/gh/apache/shardingsphere/commit/84f9266c81cf0b088f94bbfef07219675db10237?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (84f9266) will **decrease** coverage by `0.00%`.
> The diff coverage is `66.66%`.
```diff
@@ Coverage Diff @@
## master #19842 +/- ##
============================================
- Coverage 60.12% 60.12% -0.01%
- Complexity 2409 2410 +1
============================================
Files 3852 3855 +3
Lines 54936 54942 +6
Branches 7706 7706
============================================
+ Hits 33031 33032 +1
- Misses 19070 19075 +5
Partials 2835 2835
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/19842?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...common/statement/ddl/AlterStatisticsStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvQWx0ZXJTdGF0aXN0aWNzU3RhdGVtZW50LmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...gresql/ddl/PostgreSQLAlterStatisticsStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvcG9zdGdyZXNxbC9kZGwvUG9zdGdyZVNRTEFsdGVyU3RhdGlzdGljc1N0YXRlbWVudC5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...atement/impl/PostgreSQLDDLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcWwvcGFyc2VyL3Bvc3RncmVzcWwvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9Qb3N0Z3JlU1FMRERMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `85.35% <100.00%> (+0.03%)` | :arrow_up: |
| [...l/parser/core/database/visitor/SQLVisitorRule.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWVuZ2luZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9jb3JlL2RhdGFiYXNlL3Zpc2l0b3IvU1FMVmlzaXRvclJ1bGUuamF2YQ==) | `100.00% <100.00%> (ø)` | |
| [...eterized/jaxb/cases/domain/SQLParserTestCases.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vU1FMUGFyc2VyVGVzdENhc2VzLmphdmE=) | `99.29% <100.00%> (+<0.01%)` | :arrow_up: |
| [...tatement/ddl/AlterStatisticsStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RkbC9BbHRlclN0YXRpc3RpY3NTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...handler/distsql/ral/hint/enums/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/19842/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL2hpbnQvZW51bXMvSGludFNvdXJjZVR5cGUuamF2YQ==) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?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] strongduanmu commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937277243
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
Why remove ifExists?
--
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] everly-gif commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
everly-gif commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937348052
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
thank you for this tip! will keep this in my mind for my next PRs . Ill revert the changes for `DDLStatement.g4`
--
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] everly-gif commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
everly-gif commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937321651
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
you mean the postgres **gram.y** file right?
```
AlterStatsStmt:
ALTER STATISTICS any_name SET STATISTICS SignedIconst
{
AlterStatsStmt *n = makeNode(AlterStatsStmt);
n->defnames = $3;
n->missing_ok = false;
n->stxstattarget = $6;
$$ = (Node *) n;
}
| ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS SignedIconst
{
AlterStatsStmt *n = makeNode(AlterStatsStmt);
n->defnames = $5;
n->missing_ok = true;
n->stxstattarget = $8;
$$ = (Node *) n;
}
;
```
There if exists is supported.
--
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] strongduanmu commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937325426
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
Yes, document is sometimes inaccurate, and source code can give us better guidance.
--
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] strongduanmu merged pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842
--
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] everly-gif commented on a diff in pull request #19842: Support parsing `ALTER STATISTICS` in PostgreSQL
Posted by GitBox <gi...@apache.org>.
everly-gif commented on code in PR #19842:
URL: https://github.com/apache/shardingsphere/pull/19842#discussion_r937312234
##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4:
##########
@@ -1056,10 +1056,10 @@ foreignServerVersion
alterStatistics
: ALTER STATISTICS
- ( ifExists? anyName SET STATISTICS signedIconst
Review Comment:
it doesn't exsits in the PostgreSQL dialect here
https://www.postgresql.org/docs/current/sql-alterstatistics.html
--
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