public RelNode align(SetOp rel, List<RelFieldCollation> collations) { ImmutableList.Builder<RelNode> newInputs = new ImmutableList.Builder<>(); for (RelNode input : rel.getInputs()) { newInputs.add(dispatchAlign(input, collations)); } return rel.copy(rel.getTraitSet(), newInputs.build()); }
public RelNode align(SetOp rel, List<RelFieldCollation> collations) { ImmutableList.Builder<RelNode> newInputs = new ImmutableList.Builder<>(); for (RelNode input : rel.getInputs()) { newInputs.add(dispatchAlign(input, collations)); } return rel.copy(rel.getTraitSet(), newInputs.build()); }
final List<RelNode> newSetOpInputs = new ArrayList<>(); RelNode lastInput = null; for (int index = 0; index < setOp.getInputs().size(); index++) { RelNode input = setOp.getInput(index); RexNode newCondition = condition.accept(new RelOptUtil.RexInputConverter(rexBuilder, if (index == setOp.getInputs().size() - 1) { lastInput = relBuilder.push(input).filter(newCondition).build();
for (RelNode inputRel : setop.getInputs()) { if (!validSetopChild(inputRel)) { introduceDerivedTable(inputRel, setop);
for (RelNode inputRel : setop.getInputs()) { if (!validSetopChild(inputRel)) { introduceDerivedTable(inputRel, setop);
public RelDistribution distribution(SetOp rel, RelMetadataQuery mq) { return mq.distribution(rel.getInputs().get(0)); }
public Set<RelColumnOrigin> getColumnOrigins(SetOp rel, RelMetadataQuery mq, int iOutputColumn) { final Set<RelColumnOrigin> set = new HashSet<>(); for (RelNode input : rel.getInputs()) { Set<RelColumnOrigin> inputSet = mq.getColumnOrigins(input, iOutputColumn); if (inputSet == null) { return null; } set.addAll(inputSet); } return set; }
public Set<RelColumnOrigin> getColumnOrigins(SetOp rel, RelMetadataQuery mq, int iOutputColumn) { final Set<RelColumnOrigin> set = new HashSet<>(); for (RelNode input : rel.getInputs()) { Set<RelColumnOrigin> inputSet = mq.getColumnOrigins(input, iOutputColumn); if (inputSet == null) { return null; } set.addAll(inputSet); } return set; }
/** * check whether a SetOp has some children node which have correlation condition. * e.g. SELECT a FROM l WHERE b IN (SELECT r1.e FROM r1 WHERE l.a = r1.d UNION SELECT r2.i FROM r2) */ private void checkCorConditionOfSetOpInputs(SetOp setOp) { for (RelNode child : setOp.getInputs()) { checkCorConditionOfInput(child); } }
public RelDistribution distribution(SetOp rel, RelMetadataQuery mq) { return mq.distribution(rel.getInputs().get(0)); }
/** * Returns whether all the inputs of this set operator have the same row * type as its output row. * * @param compareNames Whether column names are important in the * homogeneity comparison * @return Whether all the inputs of this set operator have the same row * type as its output row */ public boolean isHomogeneous(boolean compareNames) { RelDataType unionType = getRowType(); for (RelNode input : getInputs()) { if (!RelOptUtil.areRowTypesEqual( input.getRowType(), unionType, compareNames)) { return false; } } return true; } }
/** * Returns whether all the inputs of this set operator have the same row * type as its output row. * * @param compareNames Whether column names are important in the * homogeneity comparison * @return Whether all the inputs of this set operator have the same row * type as its output row */ public boolean isHomogeneous(boolean compareNames) { RelDataType unionType = getRowType(); for (RelNode input : getInputs()) { if (!RelOptUtil.areRowTypesEqual( input.getRowType(), unionType, compareNames)) { return false; } } return true; } }
&& !Minus.class.isAssignableFrom(setOpClass)) { relBuilder.push(topOp.getInput(0)); relBuilder.pushAll(bottomOp.getInputs()); for (int index = 2; index < topOp.getInputs().size(); index++) { relBuilder.push(topOp.getInput(index)); relBuilder.pushAll(bottomOp.getInputs()); relBuilder.pushAll(Util.skip(topOp.getInputs())); int n = bottomOp.getInputs().size() + topOp.getInputs().size() - 1; if (topOp instanceof Union) {
&& !Minus.class.isAssignableFrom(setOpClass)) { relBuilder.push(topOp.getInput(0)); relBuilder.pushAll(bottomOp.getInputs()); for (int index = 2; index < topOp.getInputs().size(); index++) { relBuilder.push(topOp.getInput(index)); relBuilder.pushAll(bottomOp.getInputs()); relBuilder.pushAll(Util.skip(topOp.getInputs())); int n = bottomOp.getInputs().size() + topOp.getInputs().size() - 1; if (topOp instanceof Union) {
for (RelNode input : setOp.getInputs()) { TrimResult trimResult = trimChild(setOp, input, fieldsUsed, extraFields); for (RelNode input : setOp.getInputs()) { relBuilder.build(); relBuilder.union(setOp.all, setOp.getInputs().size()); break; case INTERSECT: relBuilder.intersect(setOp.all, setOp.getInputs().size()); break; case EXCEPT: assert setOp.getInputs().size() == 2; relBuilder.minus(setOp.all); break;
for (RelNode input : setOp.getInputs()) {
for (RelNode input : setOp.getInputs()) {
int[] adjustments = new int[origFields.size()]; final List<RelNode> newSetOpInputs = new ArrayList<>(); for (RelNode input : setOp.getInputs()) { RexNode newCondition = condition.accept(
int[] adjustments = new int[origFields.size()]; final List<RelNode> newSetOpInputs = new ArrayList<>(); for (RelNode input : setOp.getInputs()) { RexNode newCondition = condition.accept(
for (RelNode inputRel : setop.getInputs()) { if (!validSetopChild(inputRel)) { introduceDerivedTable(inputRel, setop);