-
Notifications
You must be signed in to change notification settings - Fork 751
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 compiler crash with nested queries in select as a field #43355
Merged
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
poorna2152
requested review from
sameerajayasoma and
hasithaa
as code owners
September 4, 2024 01:58
poorna2152
force-pushed
the
query_bad_sad
branch
from
September 4, 2024 03:46
58e0f90
to
12688c5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #43355 +/- ##
============================================
- Coverage 77.50% 77.50% -0.01%
+ Complexity 58596 58593 -3
============================================
Files 3438 3438
Lines 219259 219259
Branches 28924 28924
============================================
- Hits 169938 169926 -12
- Misses 39902 39914 +12
Partials 9419 9419 ☔ View full report in Codecov by Sentry. |
lochana-chathura
added
the
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
label
Sep 5, 2024
poorna2152
force-pushed
the
query_bad_sad
branch
from
September 5, 2024 16:37
12688c5
to
1d45474
Compare
poorna2152
requested review from
gimantha,
LakshanWeerasinghe,
SasinduDilshara,
MaryamZi,
heshanpadmasiri and
lochana-chathura
September 6, 2024 04:20
poorna2152
force-pushed
the
query_bad_sad
branch
from
September 6, 2024 11:46
1d45474
to
3fb731e
Compare
heshanpadmasiri
previously approved these changes
Sep 13, 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
poorna2152
force-pushed
the
query_bad_sad
branch
from
October 2, 2024 10:01
3fb731e
to
e3b2594
Compare
poorna2152
requested review from
KavinduZoysa,
warunalakshitha and
azinneera
as code owners
October 2, 2024 10:01
poorna2152
changed the title
Fix compiler crash with nested queries in select as a field
[DO NOT MERGE] Fix compiler crash with nested queries in select as a field
Oct 4, 2024
poorna2152
changed the title
[DO NOT MERGE] Fix compiler crash with nested queries in select as a field
Fix compiler crash with nested queries in select as a field
Oct 7, 2024
gimantha
approved these changes
Oct 8, 2024
gimantha
approved these changes
Oct 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
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.
Purpose
Fixes #43336
Approach
The
identifiers
map in theQueryDesugar
stores a set of identifiers and their symbols found in the lambda function created for clauses inside the query. When anidentifier
in aselect
clause is first used in a nested query or within a lambda function in a query, the symbol of thatidentifier
is marked as aclosure
symbol. For consequent usages of this identifier in the select clause this symbol that has been marked as a closure should be used (i.e. for other fields in the select clause).Consider the above code. The student identifier inside the select clause is marked as a closure variable first because it is used within a nested query as in the first field. The second field also uses this student identifier and the variable of this second usage should also refer to the Symbol that is marked as a closure because of that nested field.
The current implementation restricts to using symbols of the identifiers from this
identifiers
map when either on in a nestedQuery or within an arrow function. This fix removes that check usage.Samples
Remarks
Check List