public Integer apply(Integer oldInput) { return getNewForOldInput(oldInput); } },
public RexNode visitInputRef(RexInputRef input) { final int oldIndex = input.getIndex(); final int newIndex = getNewForOldInput(oldIndex); // FIXME: jhyde, 2005/12/3: Once indicator fields have been // introduced, the new field type may be very different to the // old field type. We should look at the actual flattened types, // rather than trying to deduce the type from the current type. RelDataType fieldType = removeDistinct(input.getType()); RexInputRef newInput = new RexInputRef(newIndex, fieldType); return newInput; }
public RexNode visitInputRef(RexInputRef input) { final int oldIndex = input.getIndex(); final int newIndex = getNewForOldInput(oldIndex); // FIXME: jhyde, 2005/12/3: Once indicator fields have been // introduced, the new field type may be very different to the // old field type. We should look at the actual flattened types, // rather than trying to deduce the type from the current type. RelDataType fieldType = removeDistinct(input.getType()); RexInputRef newInput = new RexInputRef(newIndex, fieldType); return newInput; }
public void rewriteRel(CorrelatorRel rel) { Iterator oldCorrelations = rel.getCorrelations().iterator(); ArrayList<CorrelatorRel.Correlation> newCorrelations = new ArrayList<CorrelatorRel.Correlation>(); while (oldCorrelations.hasNext()) { CorrelatorRel.Correlation c = (CorrelatorRel.Correlation) oldCorrelations.next(); RelDataType corrFieldType = rel.getLeft().getRowType().getFieldList().get(c.getOffset()) .getType(); if (corrFieldType.isStruct()) { throw Util.needToImplement("correlation on structured type"); } newCorrelations.add( new CorrelatorRel.Correlation( c.getId(), getNewForOldInput(c.getOffset()))); } CorrelatorRel newRel = new CorrelatorRel( rel.getCluster(), getNewForOldRel(rel.getLeft()), getNewForOldRel(rel.getRight()), rel.getCondition(), newCorrelations, rel.getJoinType()); setNewForOldRel(rel, newRel); }
if (exp instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) exp; int newOffset = getNewForOldInput(inputRef.getIndex());
if (exp instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) exp; int newOffset = getNewForOldInput(inputRef.getIndex());
if (refExp instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) refExp; iInput += getNewForOldInput(inputRef.getIndex()); return new RexInputRef(iInput, fieldType); } else if (refExp instanceof RexCorrelVariable) {
public void rewriteRel(CorrelatorRel rel) { final List<Correlation> newCorrelations = new ArrayList<Correlation>(); for (Correlation c : rel.getCorrelations()) { RelDataType corrFieldType = rel.getLeft().getRowType().getFieldList().get(c.getOffset()) .getType(); if (corrFieldType.isStruct()) { throw Util.needToImplement("correlation on structured type"); } newCorrelations.add( new Correlation( c.getId(), getNewForOldInput(c.getOffset()))); } CorrelatorRel newRel = new CorrelatorRel( rel.getCluster(), getNewForOldRel(rel.getLeft()), getNewForOldRel(rel.getRight()), rel.getCondition(), newCorrelations, rel.getJoinType()); setNewForOldRel(rel, newRel); }
if (refExp instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) refExp; iInput += getNewForOldInput(inputRef.getIndex()); return new RexInputRef(iInput, fieldType); } else if (refExp instanceof RexCorrelVariable) {
programBuilder.addCondition( new RexLocalRef( getNewForOldInput(conditionRef.getIndex()), conditionRef.getType()));
programBuilder.addCondition( new RexLocalRef( getNewForOldInput(conditionRef.getIndex()), conditionRef.getType()));