-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parsing SQL Server SELECT name, sql #29627
Conversation
# Conflicts: # parser/sql/dialect/sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4 # parser/sql/dialect/sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4 # parser/sql/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java # test/it/parser/src/main/resources/case/dml/select.xml # test/it/parser/src/main/resources/sql/supported/dml/select.xml
Hi @yydeng626, can you solve code conflict? |
# Conflicts: # parser/sql/dialect/sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4 # test/it/parser/src/main/resources/case/dml/insert.xml # test/it/parser/src/main/resources/sql/supported/dml/insert.xml
Sure, I will solve the conflicts. |
@strongduanmu Please check again |
@@ -692,3 +692,6 @@ WITHOUT | |||
: W I T H O U T | |||
; | |||
|
|||
APPLY | |||
: A P P L Y | |||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add new line at the end of file.
@@ -295,4 +296,27 @@ public static void setWhereSegment(final InsertStatement insertStatement, final | |||
((OracleInsertStatement) insertStatement).setWhere(whereSegment); | |||
} | |||
} | |||
|
|||
/** | |||
* get execute segment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Get in javadoc for first word.
|
||
/** | ||
* get execute segment. | ||
* @param insertStatement insert statement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add new line after javadoc and param.
import java.util.LinkedList; | ||
|
||
/** | ||
* execute segment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Execute for first word in javadoc.
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public class ExecSegment implements SQLSegment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add final for this class.
import java.util.List; | ||
|
||
/** | ||
* MySQL call statement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace MySQL with SQLServer.
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
/** | ||
* insert execute clause assert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Insert for first word.
public class InsertExecClauseAssert { | ||
|
||
/** | ||
* Assert actual execute segment is correct with expected execute clause. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add new line after java doc.
assertTrue(actual.getProcedureName().getOwner().isPresent(), assertContext.getText("Actual owner should exist.")); | ||
OwnerAssert.assertIs(assertContext, actual.getProcedureName().getOwner().get(), expected.getOwner()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this useless blank line.
@@ -591,4 +591,44 @@ | |||
</subquery-table> | |||
</from> | |||
</select> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep one blank line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yydeng626 Good job, merged.
Fixes #29174.
Changes proposed in this pull request:
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.