return call.clone(call.getType(), list);
final RelDataType type = call.getType(); List<RexNode> exprs = call.getOperands();
private static RelDataType parseCast(RexNode rex) { if (rex instanceof RexCall) { final RexCall call = (RexCall) rex; if (call.getOperator() == SqlStdOperatorTable.castFunc) { assert call.getOperands().size() == 1; return call.getType(); } } return null; }
public RexNode visitCall(RexCall call) { final List<RexNode> newOperands = new ArrayList<RexNode>(); for (RexNode operand : call.getOperands()) { newOperands.add(operand.accept(this)); } return call.clone(call.getType(), newOperands); }
public RexNode visitCall(RexCall call) { final List<RexNode> newOperands = new ArrayList<RexNode>(); for (RexNode operand : call.getOperands()) { newOperands.add(operand.accept(this)); } return call.clone(call.getType(), newOperands); }
@Override public RexNode visitCall(RexCall call) { final Integer integer = map.get(call.toString()); if (integer != null) { return new RexInputRef(integer, call.getType()); } return super.visitCall(call); } };
public Expression implement(RexToLixTranslator translator, RexCall call, NullAs nullAs) { // Short-circuit if no cast is required RexNode arg = call.getOperands().get(0); if (call.getType().equals(arg.getType())) { // No cast required, omit cast return translator.translate(arg, nullAs); } return accurate.implement(translator, call, nullAs); } }
/** * Returns true if call is call to <code>CAST</code> and the to/from cast * types are of multiset types */ public static boolean isMultisetCast(RexCall call) { if (!call.getOperator().equals(SqlStdOperatorTable.castFunc)) { return false; } return call.getType().getSqlTypeName() == SqlTypeName.MULTISET; }
/** * Returns true if call is call to <code>CAST</code> and the to/from cast * types are of multiset types */ public static boolean isMultisetCast(RexCall call) { if (!call.getOperator().equals(SqlStdOperatorTable.CAST)) { return false; } return call.getType().getSqlTypeName() == SqlTypeName.MULTISET; }
@Override public Void visitCall(RexCall call) { if (call.getOperator() == RexBuilder.GET_OPERATOR) { RexLiteral literal = (RexLiteral) call.getOperands().get(1); extraFields.add( new RelDataTypeFieldImpl( (String) literal.getValue2(), -1, call.getType())); } return super.visitCall(call); } }
private static RexCall call2( boolean harmonize, RexToLixTranslator translator, RexCall call) { if (!harmonize) { return call; } final List<RexNode> operands2 = harmonize(translator, call.getOperands()); if (operands2.equals(call.getOperands())) { return call; } return call.clone(call.getType(), operands2); }
private Expression implementRecurse( RexToLixTranslator translator, RexCall call, int i) { List<RexNode> operands = call.getOperands(); if (i == operands.size() - 1) { // the "else" clause return translator.translate( translator.builder.ensureType( call.getType(), operands.get(i), false)); } else { return Expressions.condition( translator.translate(operands.get(i), NullAs.FALSE), translator.translate( translator.builder.ensureType(call.getType(), operands.get(i + 1), false)), implementRecurse(translator, call, i + 2)); } } }
@Override public Void visitCall(RexCall call) { if (call.getOperator() == RexBuilder.GET_OPERATOR) { RexLiteral literal = (RexLiteral) call.getOperands().get(1); extraFields.add( new RelDataTypeFieldImpl( (String) literal.getValue2(), -1, call.getType())); } return super.visitCall(call); } }
private static RexCall call2( boolean harmonize, RexToLixTranslator translator, RexCall call) { if (!harmonize) { return call; } final List<RexNode> operands2 = harmonize(translator, call.getOperands()); if (operands2.equals(call.getOperands())) { return call; } return call.clone(call.getType(), operands2); }
public RexNode visitCall(final RexCall call) { boolean [] update = { false }; List<RexNode> clonedOperands = visitList(call.operands, update); if (update[0]) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexCall( call.getType(), call.getOperator(), clonedOperands); } else { return call; } }
public RexNode visitCall(final RexCall call) { boolean[] update = {false}; List<RexNode> clonedOperands = visitList(call.operands, update); if (update[0]) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexCall( call.getType(), call.getOperator(), clonedOperands); } else { return call; } }
private RexNode expandPlusMinus(RexCall call, List<RexNode> operands) { RelDataType outType = call.getType(); int outScale = outType.getScale(); return encodeValue( builder.makeCall( call.getOperator(), ensureScale( accessValue(operands.get(0)), scaleA, outScale), ensureScale( accessValue(operands.get(1)), scaleB, outScale)), outType); }
private RexNode expandPlusMinus(RexCall call, List<RexNode> operands) { RelDataType outType = call.getType(); int outScale = outType.getScale(); return encodeValue( builder.makeCall( call.getOperator(), ensureScale( accessValue(operands.get(0)), scaleA, outScale), ensureScale( accessValue(operands.get(1)), scaleB, outScale)), outType); }
public RexNode visitCall(final RexCall call) { return builder.makeCall( builder.getTypeFactory().copyType(call.getType()), call.getOperator(), visitList(call.getOperands(), null)); }
public RexNode visitCall(final RexCall call) { final boolean[] update = null; return builder.makeCall( builder.getTypeFactory().copyType(call.getType()), call.getOperator(), visitList(call.getOperands(), update)); }