-
Notifications
You must be signed in to change notification settings - Fork 758
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
Fix collect clause not supported inside a query action statement #41413
Fix collect clause not supported inside a query action statement #41413
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #41413 +/- ##
=========================================
Coverage 76.67% 76.67%
- Complexity 53002 53020 +18
=========================================
Files 2883 2883
Lines 199881 199924 +43
Branches 26011 26024 +13
=========================================
+ Hits 153264 153301 +37
- Misses 38157 38160 +3
- Partials 8460 8463 +3 ☔ View full report in Codecov by Sentry. |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
tests/jballerina-unit-test/src/test/resources/test-src/query/query-action.bal
Outdated
Show resolved
Hide resolved
Closed PR due to inactivity for more than 18 days. |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Closed PR due to inactivity for more than 18 days. |
@@ -11949,7 +11949,8 @@ private STNode parseQueryExprRhs(STNode queryConstructType, boolean isRhsExpr, b | |||
} | |||
} | |||
|
|||
if (peek().kind == SyntaxKind.DO_KEYWORD && (!isNestedQueryExpr() || selectClause == null)) { | |||
if (peek().kind == SyntaxKind.DO_KEYWORD && |
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.
Shall we add few parser tests for this. include some with collect clause inside do, group-by clauses
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.
Added in commit #6edfe50
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Closed PR due to inactivity for more than 18 days. |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Closed PR due to inactivity for more than 18 days. |
2d65472
to
6edfe50
Compare
tests/jballerina-unit-test/src/test/resources/test-src/query/query-action.bal
Show resolved
Hide resolved
@@ -11949,7 +11949,8 @@ private STNode parseQueryExprRhs(STNode queryConstructType, boolean isRhsExpr, b | |||
} | |||
} | |||
|
|||
if (peek().kind == SyntaxKind.DO_KEYWORD && (!isNestedQueryExpr() || selectClause == null)) { | |||
if (peek().kind == SyntaxKind.DO_KEYWORD && | |||
(!isNestedQueryExpr() || (selectClause == null && collectClause == null))) { | |||
STNode intermediateClauses = STNodeFactory.createNodeList(clauses); | |||
STNode queryPipeline = STNodeFactory.createQueryPipelineNode(fromClause, intermediateClauses); | |||
return parseQueryAction(queryConstructType, queryPipeline, selectClause); |
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.
We have to pass collectClause
here and handle it.
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.
updated in #4fd2d8.
@@ -1,2 +1,14 @@ | |||
public function main() { | |||
function foo() { |
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.
@LakshanWeerasinghe Do we need to change this file? Shall we change this back to the original, please?
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.
Fix in #42254.
Purpose
$subject
Fixes #41392
Check List