protected RexCall( RelDataType type, SqlOperator op, List<? extends RexNode> operands) { assert type != null : "precondition: type != null"; assert op != null : "precondition: op != null"; assert operands != null : "precondition: operands != null"; this.type = type; this.op = op; this.operands = ImmutableList.copyOf(operands); this.kind = sqlKindToRexKind(op.getKind()); assert this.kind != null : op; this.digest = computeDigest(true); // TODO zfong 11/19/07 - Extend the check below to all types of // operators, similar to SqlOperator.checkOperandCount. However, // that method operates on SqlCalls, which may have not have the // same number of operands as their corresponding RexCalls. One // example is the CAST operator, which is originally a 2-operand // SqlCall, but is later converted to a 1-operand RexCall. if (op instanceof SqlBinaryOperator) { assert operands.size() == 2; } }