Skip to content
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

Merged
merged 7 commits into from
Jan 23, 2024

Conversation

LakshanWeerasinghe
Copy link
Contributor

Purpose

$subject

Fixes #41392

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@LakshanWeerasinghe LakshanWeerasinghe added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Lang/Actions/Query Area/Parser Everything related to the ballerina lexer and the parser #Compiler labels Sep 19, 2023
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (998b57c) 76.67% compared to head (445546b) 76.67%.
Report is 43 commits behind head on master.

Files Patch % Lines
.../compiler/bir/codegen/interop/JMethodResolver.java 80.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Oct 4, 2023
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Closed PR due to inactivity for more than 18 days.

@github-actions
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Oct 24, 2023
@github-actions
Copy link

Closed PR due to inactivity for more than 18 days.

@github-actions github-actions bot closed this Oct 28, 2023
@pcnfernando pcnfernando removed the Stale label Oct 29, 2023
@pcnfernando pcnfernando reopened this Oct 29, 2023
@@ -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 &&
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in commit #6edfe50

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Nov 13, 2023
Copy link

Closed PR due to inactivity for more than 18 days.

Copy link

github-actions bot commented Dec 5, 2023

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Dec 5, 2023
Copy link

github-actions bot commented Dec 9, 2023

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 &&
(!isNestedQueryExpr() || (selectClause == null && collectClause == null))) {
STNode intermediateClauses = STNodeFactory.createNodeList(clauses);
STNode queryPipeline = STNodeFactory.createQueryPipelineNode(fromClause, intermediateClauses);
return parseQueryAction(queryConstructType, queryPipeline, selectClause);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in #4fd2d8.

@KavinduZoysa KavinduZoysa merged commit 859fff4 into ballerina-platform:master Jan 23, 2024
18 checks passed
@@ -1,2 +1,14 @@
public function main() {
function foo() {
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in #42254.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Parser Everything related to the ballerina lexer and the parser #Compiler Lang/Actions/Query Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Compilation fails when do clause is present after an aggregation
5 participants