-
Notifications
You must be signed in to change notification settings - Fork 62
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
Prevent the ORDER BY clause from being dropped in visitor transforms #420
Conversation
Fixes #417 Dropping the ORDER BY clause prevents the EvaluationException from being thrown by EvaluatingCompiler due to not having evaluation support for ORDER BY, effectively ignoring the ORDER BY clause.
Codecov Report
@@ Coverage Diff @@
## master #420 +/- ##
============================================
+ Coverage 82.24% 82.29% +0.04%
+ Complexity 1400 1394 -6
============================================
Files 171 171
Lines 10724 10725 +1
Branches 1776 1769 -7
============================================
+ Hits 8820 8826 +6
+ Misses 1362 1358 -4
+ Partials 542 541 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
||
val having = node.having?.let { currentAndUnshadowedTransformer.transformExprSelect_having(node) } | ||
|
||
val order = node.having?.let { currentAndUnshadowedTransformer.transformExprSelect_order(node) } |
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.
Bug caused by:
`val order = node.having?...`
All the ?.let
calls were unnecessary here anyway too...
@@ -22,6 +22,7 @@ class SelectStarVisitorTransform : VisitorTransformBase() { | |||
where = node.where, | |||
group = node.group, | |||
having = node.having, | |||
order = node.order, |
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.
bug: this was omitted previously
FWIW, this is the one bug that would have been prevented by using the .copy
function, since all we really wanted to do was replace the projection
node.
@@ -40,7 +40,7 @@ abstract class VisitorTransformBase : PartiqlAst.VisitorTransform() { | |||
val having = transformExprSelect_having(node) | |||
val setq = transformExprSelect_setq(node) | |||
val project = transformExprSelect_project(node) | |||
val order = node.having?.let { transformExprSelect_order(node) } | |||
val order = transformExprSelect_order(node) |
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.
similar to above. bug:
val order = node.having?.let ...
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.
🚢
Fixes #417
Dropping the
ORDER BY
clause prevents theEvaluationException
from being thrown byEvaluatingCompiler
due to not having evaluation support forORDER BY
, effectively ignoring theORDER BY
clause.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.