Skip to content

Commit

Permalink
Add err messages; use nil
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Jul 15, 2024
1 parent b7b6216 commit abdeaec
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,14 @@ internal object RelConverter {
override fun visitExprBagOp(node: Expr.BagOp, ctx: Rel): Rel {
// Assumes parser correctly only allows Expr.SFW or other Expr.BagOps with Expr.SFW arguments when
// converting to the SQL set op
assert(node.lhs is Expr.SFW || node.lhs is Expr.BagOp)
assert(node.rhs is Expr.SFW || node.rhs is Expr.BagOp)
assert(node.lhs is Expr.SFW || node.lhs is Expr.BagOp) {
"Expect LHS of bag op to be a Expr.SFW or a Expr.BagOp. " +
"However, it is ${node.lhs}."
}
assert(node.rhs is Expr.SFW || node.rhs is Expr.BagOp) {
"Expect RHS of bag op to be a Expr.SFW or a Expr.BagOp. " +
"However, it is ${node.lhs}."
}
val setq = when (node.type.setq) {
SetQuantifier.ALL -> org.partiql.planner.internal.ir.SetQuantifier.ALL
null, SetQuantifier.DISTINCT -> org.partiql.planner.internal.ir.SetQuantifier.DISTINCT
Expand All @@ -178,7 +184,7 @@ internal object RelConverter {
SetOp.Type.INTERSECT -> Rel.Op.Intersect(setq, lhsRel, rhsRel)
}
return Rel(
type = Rel.Type(listOf(Rel.Binding("_0", StaticType.ANY)), props = emptySet()),
type = nil.type,
op = op
)
}
Expand Down

0 comments on commit abdeaec

Please sign in to comment.