@Override public RelNode visit(LogicalIntersect intersect) { return new LogicalIntersect( cluster, copyOf(intersect.getTraitSet()), visitAll(intersect.getInputs()), intersect.all ); }
@Override public LogicalIntersect copy(RelTraitSet traitSet, List<RelNode> inputs, boolean all) { return new LogicalIntersect(getCluster(), traitSet, inputs, all); }
public RelNode createSetOp(SqlKind kind, List<RelNode> inputs, boolean all) { switch (kind) { case UNION: return LogicalUnion.create(inputs, all); case EXCEPT: return LogicalMinus.create(inputs, all); case INTERSECT: return LogicalIntersect.create(inputs, all); default: throw new AssertionError("not a set op: " + kind); } } }
public RelNode convert(RelNode rel) { final LogicalIntersect intersect = (LogicalIntersect) rel; if (intersect.all) { return null; // INTERSECT ALL not implemented } final EnumerableConvention out = EnumerableConvention.INSTANCE; final RelTraitSet traitSet = intersect.getTraitSet().replace(out); return new EnumerableIntersect(rel.getCluster(), traitSet, convertList(intersect.getInputs(), out), false); } }
/** Creates a LogicalIntersect. */ public static LogicalIntersect create(List<RelNode> inputs, boolean all) { final RelOptCluster cluster = inputs.get(0).getCluster(); final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE); return new LogicalIntersect(cluster, traitSet, inputs, all); }
public RelNode createSetOp(SqlKind kind, List<RelNode> inputs, boolean all) { switch (kind) { case UNION: return LogicalUnion.create(inputs, all); case EXCEPT: return LogicalMinus.create(inputs, all); case INTERSECT: return LogicalIntersect.create(inputs, all); default: throw new AssertionError("not a set op: " + kind); } } }
public RelNode convert(RelNode rel) { final LogicalIntersect intersect = (LogicalIntersect) rel; if (intersect.all) { return null; // INTERSECT ALL not implemented } final EnumerableConvention out = EnumerableConvention.INSTANCE; final RelTraitSet traitSet = intersect.getTraitSet().replace(out); return new EnumerableIntersect(rel.getCluster(), traitSet, convertList(intersect.getInputs(), out), false); } }
/** Creates a LogicalIntersect. */ public static LogicalIntersect create(List<RelNode> inputs, boolean all) { final RelOptCluster cluster = inputs.get(0).getCluster(); final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE); return new LogicalIntersect(cluster, traitSet, inputs, all); }
/** * 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()); } }
@Override public LogicalIntersect copy(RelTraitSet traitSet, List<RelNode> inputs, boolean all) { return new LogicalIntersect(getCluster(), traitSet, inputs, all); }
/** * 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()); } }