@Override public RexNode visitInputRef(RexInputRef inputRef) { final RexInputRef ref = getNewForOldInputRef(inputRef); if (ref.getIndex() == inputRef.getIndex() && ref.getType() == inputRef.getType()) { return inputRef; // re-use old object, to prevent needless expr cloning } return ref; } private RexNode decorrFieldAccess(RexFieldAccess fieldAccess) {
@Override public RexNode visitInputRef(RexInputRef ref) { final Integer integer = map.get(ref.getName()); if (integer != null) { return new RexInputRef(integer, ref.getType()); } throw MatchFailed.INSTANCE; }
@Override public Void visitInputRef(RexInputRef inputRef) { if (!areTypesCompatible(inputRef.getType(), types.get(inputRef.getIndex()).getType())) { throw new Util.FoundOne(inputRef); } return super.visitInputRef(inputRef); }
if (operand instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) operand; if (!inputRef.getType().isNullable()) { if (alwaysTrue) { call.transformTo(filter.getInput());
@Override public RexNode visitInputRef(RexInputRef inputRef) { if (currentRel instanceof LogicalCorrelate) { // if this rel references corVar // and now it needs to be rewritten // it must have been pulled above the Correlator // replace the input ref to account for the LHS of the // Correlator final int leftInputFieldCount = ((LogicalCorrelate) currentRel).getLeft().getRowType() .getFieldCount(); RelDataType newType = inputRef.getType(); if (projectPulledAboveLeftCorrelator) { newType = typeFactory.createTypeWithNullability(newType, true); } int pos = inputRef.getIndex(); RexInputRef newInputRef = new RexInputRef(leftInputFieldCount + pos, newType); if ((isCount != null) && isCount.contains(pos)) { return createCaseExpression( newInputRef, rexBuilder.makeExactLiteral(BigDecimal.ZERO), newInputRef); } else { return newInputRef; } } return inputRef; }
if (operand instanceof RexInputRef) { RexInputRef inputRef = (RexInputRef) operand; if (!inputRef.getType().isNullable()) { if (alwaysTrue) { call.transformTo(filter.getInput());
int oldFieldSize = currentRel.getInput(0).getRowType().getFieldCount(); int newOrd = newFrame.r.getRowType().getFieldCount() + oldOrdinalNo - oldFieldSize; return new RexInputRef(newOrd, oldInputRef.getType());
@Override public RexNode visitInputRef(RexInputRef inputRef) { if (currentRel instanceof LogicalCorrelate) { // if this rel references corVar // and now it needs to be rewritten // it must have been pulled above the Correlator // replace the input ref to account for the LHS of the // Correlator final int leftInputFieldCount = ((LogicalCorrelate) currentRel).getLeft().getRowType() .getFieldCount(); RelDataType newType = inputRef.getType(); if (projectPulledAboveLeftCorrelator) { newType = typeFactory.createTypeWithNullability(newType, true); } int pos = inputRef.getIndex(); RexInputRef newInputRef = new RexInputRef(leftInputFieldCount + pos, newType); if ((isCount != null) && isCount.contains(pos)) { return createCaseExpression( newInputRef, rexBuilder.makeExactLiteral(BigDecimal.ZERO), newInputRef); } else { return newInputRef; } } return inputRef; }
nullInputRef.getIndex(), typeFactory.createTypeWithNullability( nullInputRef.getType(), true)));
nullInputRef.getIndex(), typeFactory.createTypeWithNullability( nullInputRef.getType(), true)));
@Override public RexNode visitInputRef(RexInputRef inputRef) { final RexInputRef ref = getNewForOldInputRef(currentRel, map, inputRef); if (ref.getIndex() == inputRef.getIndex() && ref.getType() == inputRef.getType()) { return inputRef; // re-use old object, to prevent needless expr cloning } return ref; } }
@Override public RexNode visitInputRef(RexInputRef inputRef) { final RexInputRef ref = getNewForOldInputRef(currentRel, map, inputRef); if (ref.getIndex() == inputRef.getIndex() && ref.getType() == inputRef.getType()) { return inputRef; // re-use old object, to prevent needless expr cloning } return ref; } }
private void validateJoinKeys(RexInputRef ref) { SqlTypeName sqlTypeName = ref.getType().getSqlTypeName(); // Primitive types and ANY (for the record key) are supported in the key if (sqlTypeName != SqlTypeName.BOOLEAN && sqlTypeName != SqlTypeName.TINYINT && sqlTypeName != SqlTypeName.SMALLINT && sqlTypeName != SqlTypeName.INTEGER && sqlTypeName != SqlTypeName.CHAR && sqlTypeName != SqlTypeName.BIGINT && sqlTypeName != SqlTypeName.VARCHAR && sqlTypeName != SqlTypeName.DOUBLE && sqlTypeName != SqlTypeName.FLOAT && sqlTypeName != SqlTypeName.ANY && sqlTypeName != SqlTypeName.OTHER) { log.error("Unsupported key type " + sqlTypeName + " used in join condition."); throw new SamzaException("Unsupported key type used in join condition."); } }
@Override public RexNode visitInputRef(RexInputRef ref) { final Integer integer = map.get(ref.getName()); if (integer != null) { return new RexInputRef(integer, ref.getType()); } throw MatchFailed.INSTANCE; }
@Override public RexNode visitInputRef(RexInputRef input) { final int index = input.getIndex(); if (index < start) { return input; } return new RexInputRef(index + offset, input.getType()); } });
@Override public RexNode visitInputRef(RexInputRef inputRef) { final int newIndex = getAdjustedIndex(inputRef.getIndex(), beReferred, windowInputColumn); return new RexInputRef(newIndex, inputRef.getType()); }
@Override public RexNode visitInputRef(RexInputRef inputRef) { int pos = mapping.getTargetOpt(inputRef.getIndex()); if (pos != -1) { // Found it return rexBuilder.makeInputRef(inputRef.getType(), pos); } throw Util.FoundOne.NULL; } };
@Override public RexNode visitInputRef(RexInputRef inputRef) { int pos = mapping.getTargetOpt(inputRef.getIndex()); if (pos != -1) { // Found it return rexBuilder.makeInputRef(inputRef.getType(), pos); } throw Util.FoundOne.NULL; } };