kanha-gupta commented on code in PR #26038:
URL: https://github.com/apache/shardingsphere/pull/26038#discussion_r1224581966
##########
parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java:
##########
@@ -980,9 +982,22 @@ public ASTNode visitHavingClause(final HavingClauseContext
ctx) {
@Override
public ASTNode visitWindowClause(final WindowClauseContext ctx) {
+ if (null != ctx.windowDefinitionList()) {
+ return new WindowSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(),
getWindowItem(ctx.windowDefinitionList().windowDefinition()),
+
getWindowSpecification(ctx.windowDefinitionList().windowDefinition().windowSpecification()));
+ }
return new WindowSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex());
}
+ private IdentifierValue getWindowItem(final WindowDefinitionContext ctx) {
+ return new IdentifierValue(ctx.colId().identifier().getText());
+ }
+
+ private Collection<ExpressionSegment> getWindowSpecification(final
WindowSpecificationContext ctx) {
Review Comment:
sir, I have added sql parse test case in the new xml file for Mysql,
PostgreSQL & opengauss.
is there any other test to add ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]