-
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
Added Pos and Neg operators. #532
Conversation
Codecov Report
@@ Coverage Diff @@
## deprecate-exprnode #532 +/- ##
========================================================
- Coverage 80.72% 80.64% -0.08%
- Complexity 1694 1696 +2
========================================================
Files 196 196
Lines 14387 14413 +26
Branches 2977 2985 +8
========================================================
+ Hits 11614 11624 +10
- Misses 1811 1819 +8
- Partials 962 970 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Could we also have the motivation in the PR notes (or the related issue if there is one)? |
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.
A couple typos in the EvaluatingCompiler
and a couple nits in the inferencer. Could you also add more context for this PR? May want to mention that ExprNode
had modeled unary +
and -
as the same as NAry, while PartiqlAst
models them as separate nodes.
lang/src/org/partiql/lang/eval/visitors/StaticTypeInferenceVisitorTransform.kt
Outdated
Show resolved
Hide resolved
lang/src/org/partiql/lang/eval/visitors/StaticTypeInferenceVisitorTransform.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Alan Cai <caialan@amazon.com>
Co-authored-by: Alan Cai <caialan@amazon.com>
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.
Motivation:
As we are replacing
ExprNode
with PIG-generated AST, we need to resolve the inconsistency between them.With 2 or more arguments provided,
ExprNode
usesNAry.add
(NAry.Sub
) to model the addition operator, while PIG-generated AST usesPlus
(Minus
) to model it. However, with only one argument provided, the addition operator is modeled asPos
(Neg
) in PIG AST, while inExprNode
it is stillNAry.add
(NAry.Sub
).This PR aims to resolve this inconsistency.
Suggested reviewing order: