-
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
Migrate AggregateSupportRewriter to PartiqlAst.VisitorTransform and ExprNode GroupBy
-> PIG GroupBy
bug
#305
Migrate AggregateSupportRewriter to PartiqlAst.VisitorTransform and ExprNode GroupBy
-> PIG GroupBy
bug
#305
Conversation
Codecov Report
@@ Coverage Diff @@
## visitor-transforms #305 +/- ##
========================================================
+ Coverage 82.33% 82.36% +0.03%
- Complexity 1227 1229 +2
========================================================
Files 159 159
Lines 9386 9402 +16
Branches 1531 1533 +2
========================================================
+ Hits 7728 7744 +16
Misses 1197 1197
Partials 461 461
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Alternate version converting the This commit shows how converting may look from the VisitorTransform, leaving the evaluator the same (i.e. using the ExprNode type for Wasn't sure how to get around passing the |
GroupBy
-> PIG GroupBy
bugGroupBy
-> PIG GroupBy
bug
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 in general, the only changes I recommend are to my own poor wording in the kdoc
I originally wrote.
lang/src/org/partiql/lang/eval/visitors/AggregateSupportVisitorTransform.kt
Outdated
Show resolved
Hide resolved
lang/src/org/partiql/lang/eval/visitors/AggregateSupportVisitorTransform.kt
Outdated
Show resolved
Hide resolved
Yes, column 12 seems to be the correct location for that error. |
lang/src/org/partiql/lang/eval/visitors/AggregateSupportVisitorTransform.kt
Show resolved
Hide resolved
…xprNode `GroupBy`-> PIG `GroupBy` bug (#305)
Migrate AggregateSupportRewriter to PartiqlAst.VisitorTransform.
Also fixes bug in
ExprNodeToStatement
when converting ExprNodeGroupBy
into PIGGroupBy
. Previously, metas part of a givengroupKey
were not included, causing some missing meta errors when calling.toAstStatement
with an ExprNode that had a GroupBy clause.Need to resolve whether a
CallAgg
used in the evaluator should be stored as an ExprNode or PIG version when doing the VisitorTransform (i.e. when should theCallAgg
be converted into an ExprNodeCallAgg
, in the VisitorTransform, evaluator, or somewhere else?). This current PR does the conversion in the evaluator and leaves the ExprNode concept out of the VisitorTransform. However, it may actually be better to do it in the VisitorTransform (still need to try it out).Also need to discuss if there's a better way to convert parts of the
CallAgg
from the PIG version to the ExprNode version. In the current approach, I had to expose some methods from StatementToExprNode.kt to get this working.Lastly, ran into an issue where an existing test,
selectListNestedAggregateCall
, may have incorrect behavior? It would make more sense to me that the error's source location should be column 12, which is where the nested aggregate starts. This could be a potential bug in using the wrong metas in the evaluator.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.