/** * Converts a set operation (UNION, INTERSECT, MINUS) into relational * expressions. * * @param call Call to set operator * @return Relational expression */ protected RelNode convertSetOp(SqlCall call) { final RelNode left = convertQueryRecursive(call.operand(0), false, null).project(); final RelNode right = convertQueryRecursive(call.operand(1), false, null).project(); switch (call.getKind()) { case UNION: return LogicalUnion.create(ImmutableList.of(left, right), all(call)); case INTERSECT: return LogicalIntersect.create(ImmutableList.of(left, right), all(call)); case EXCEPT: return LogicalMinus.create(ImmutableList.of(left, right), all(call)); default: throw Util.unexpected(call.getKind()); } }
/** * Converts a set operation (UNION, INTERSECT, MINUS) into relational * expressions. * * @param call Call to set operator * @return Relational expression */ protected RelNode convertSetOp(SqlCall call) { final RelNode left = convertQueryRecursive(call.operand(0), false, null).project(); final RelNode right = convertQueryRecursive(call.operand(1), false, null).project(); switch (call.getKind()) { case UNION: return LogicalUnion.create(ImmutableList.of(left, right), all(call)); case INTERSECT: return LogicalIntersect.create(ImmutableList.of(left, right), all(call)); case EXCEPT: return LogicalMinus.create(ImmutableList.of(left, right), all(call)); default: throw Util.unexpected(call.getKind()); } }
/** * Converts a set operation (UNION, INTERSECT, MINUS) into relational * expressions. * * @param call Call to set operator * @return Relational expression */ protected RelNode convertSetOp(SqlCall call) { final RelNode left = convertQueryRecursive(call.operand(0), false, null).project(); final RelNode right = convertQueryRecursive(call.operand(1), false, null).project(); switch (call.getKind()) { case UNION: return LogicalUnion.create(ImmutableList.of(left, right), all(call)); case INTERSECT: return LogicalIntersect.create(ImmutableList.of(left, right), all(call)); case EXCEPT: return LogicalMinus.create(ImmutableList.of(left, right), all(call)); default: throw Util.unexpected(call.getKind()); } }
/** * Converts a set operation (UNION, INTERSECT, MINUS) into relational * expressions. * * @param call Call to set operator * @return Relational expression */ protected RelNode convertSetOp(SqlCall call) { final RelNode left = convertQueryRecursive(call.operand(0), false, null).project(); final RelNode right = convertQueryRecursive(call.operand(1), false, null).project(); switch (call.getKind()) { case UNION: return LogicalUnion.create(ImmutableList.of(left, right), all(call)); case INTERSECT: return LogicalIntersect.create(ImmutableList.of(left, right), all(call)); case EXCEPT: return LogicalMinus.create(ImmutableList.of(left, right), all(call)); default: throw Util.unexpected(call.getKind()); } }