-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat(logicaldatabase): logical table expression parser #2274
Merged
yhilmare
merged 20 commits into
dev/4.3.x
from
lebie_430_logicaldatabase_expression_parse_0416
Apr 29, 2024
Merged
feat(logicaldatabase): logical table expression parser #2274
yhilmare
merged 20 commits into
dev/4.3.x
from
lebie_430_logicaldatabase_expression_parse_0416
Apr 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yhilmare
changed the title
feat(logicaldatabase): logical table expression parser
[WIP] feat(logicaldatabase): logical table expression parser
Apr 23, 2024
MarkPotato777
requested review from
Jane201510,
JessieWuJiexi and
smallsheeeep
as code owners
April 23, 2024 12:58
MarkPotato777
changed the title
[WIP] feat(logicaldatabase): logical table expression parser
feat(logicaldatabase): logical table expression parser
Apr 23, 2024
…ldatabase_expression_parse_0416
yizhouxw
reviewed
Apr 25, 2024
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.
great job 👍
server/odc-core/src/main/java/com/oceanbase/odc/core/shared/constant/ErrorCodes.java
Outdated
Show resolved
Hide resolved
yhilmare
reviewed
Apr 25, 2024
...c/main/java/com/oceanbase/odc/service/connection/logicaldatabase/BadExpressionException.java
Outdated
Show resolved
Hide resolved
...nbase/odc/service/connection/logicaldatabase/parser/DefaultLogicalTableExpressionParser.java
Outdated
Show resolved
Hide resolved
...nbase/odc/service/connection/logicaldatabase/parser/DefaultLogicalTableExpressionParser.java
Outdated
Show resolved
Hide resolved
...n/java/com/oceanbase/odc/service/connection/logicaldatabase/parser/SyntaxErrorException.java
Outdated
Show resolved
Hide resolved
.../java/com/oceanbase/odc/service/connection/logicaldatabase/parser/FastFailErrorListener.java
Outdated
Show resolved
Hide resolved
yhilmare
reviewed
Apr 25, 2024
server/odc-service/src/main/resources/antlr/logicaldatabase/LogicalTableExpression.g4
Show resolved
Hide resolved
yhilmare
reviewed
Apr 25, 2024
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
...m/oceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionVisitor.java
Show resolved
Hide resolved
yhilmare
reviewed
Apr 28, 2024
...ceanbase/odc/service/connection/logicaldatabase/parser/LogicalTableExpressionParseUtils.java
Outdated
Show resolved
Hide resolved
yhilmare
approved these changes
Apr 28, 2024
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.
lgtm
JessieWuJiexi
approved these changes
Apr 29, 2024
smallsheeeep
approved these changes
Apr 29, 2024
PeachThinking
approved these changes
Apr 29, 2024
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
type-feature
What this PR does / why we need it:
This PR supports parsing logical table expressions.
Visitor
class from ANTLR4 has been extended to implement specific business logic.BaseStatement
abstraction defined by theob-sql-parser
to avoid some repetitive tasks, such asgetText
,getStart
,getStop
, etc.LogicalTableService#resolve
, which is used to parse an expression into aList<DataNode>
. Its implementation uses DefaultLogicalTableExpressionParser to parse and obtainBaseLogicalTableExpression
, and then callsBaseLogicalTableExpression#evaluate
to compute all the values derived from the expression.BadExpressionException
has been defined for scenarios involving illegal expressions. This may be due to lexical or syntactic errors detected by ANTLR4 parsing, or could be semantic errors defined at the business layer, such as the requirement for the number of tables to be evenly divisible by the number of databases.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Additional documentation e.g., usage docs, etc.: