-
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
Add set op typing; fixes various behaviors in set op parsing and modeling #1506
Changes from 8 commits
9b1b677
35760f7
f46dd22
58df6f7
af7bc0b
0bd0572
2f7ccc7
0dd43ea
b7b6216
abdeaec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group=org.partiql | ||
version=0.14.6-SNAPSHOT | ||
version=0.14.6 | ||
|
||
ossrhUsername=EMPTY | ||
ossrhPassword=EMPTY | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -500,7 +500,7 @@ expr::[ | |
where: optional::expr, | ||
group_by: optional::group_by, | ||
having: optional::expr, | ||
set_op: optional::{ | ||
set_op: optional::{ // TODO modeling of `set_op` needs updated to support left-associative set ops https://github.com/partiql/partiql-lang-kotlin/issues/1507 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current modeling of SQL set ops is not correct in the AST (see #1507). I chose to just reuse the We should fix the modeling before the |
||
type: '.set_op', | ||
operand: '.expr.s_f_w', | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,7 +320,14 @@ class QueryPrettyPrinter { | |
is PartiqlAst.Expr.Or -> writeNAryOperator("OR", node.operands, sb, level) | ||
is PartiqlAst.Expr.InCollection -> writeNAryOperator("IN", node.operands, sb, level) | ||
is PartiqlAst.Expr.BagOp -> { | ||
var name = node.op.javaClass.simpleName.toUpperCase().replace("_", " ") | ||
var name = when (node.op) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Buggy previous behavior would print Could have been more clever w/ printing but since this is legacy code that will be removed ahead of |
||
is PartiqlAst.BagOpType.Except -> "EXCEPT" | ||
is PartiqlAst.BagOpType.Intersect -> "INTERSECT" | ||
is PartiqlAst.BagOpType.Union -> "UNION" | ||
is PartiqlAst.BagOpType.OuterExcept -> "OUTER EXCEPT" | ||
is PartiqlAst.BagOpType.OuterIntersect -> "OUTER INTERSECT" | ||
is PartiqlAst.BagOpType.OuterUnion -> "OUTER UNION" | ||
} | ||
if (node.quantifier is PartiqlAst.SetQuantifier.All) { | ||
name += " ALL" | ||
} | ||
|
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.
Did you drop SNAPSHOT for the release?
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.
yeah -- was planning to cut the 0.14.6 release after this PR gets merged in