public RexNode apply(Pair<RexNode, SqlNode> pair) { return rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, pair.left, bb.convertExpression(pair.right)); } }),
final int fieldCount = rex.getType().getFieldCount(); RexNode rexNode = rexBuilder.makeFieldAccess(rex, fieldCount - 1); rexNode = rexBuilder.makeCall(SqlStdOperatorTable.IS_TRUE, rexNode); for (int i = 0; i < k; i++) { rexNode = rexBuilder.makeCall( SqlStdOperatorTable.AND, rexNode, rexBuilder.makeCall( SqlStdOperatorTable.IS_NOT_NULL, rexBuilder.makeFieldAccess(rex, i))); args.add(rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, cRef, zero), falseLiteral, rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, iRef), trueLiteral); final JoinInfo joinInfo = join.analyzeCondition(); for (int leftKey : joinInfo.leftKeys) { final RexNode kRef = rexBuilder.makeInputRef(root, leftKey); args.add(rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, kRef), unknownLiteral); args.add(rexBuilder.makeCall(SqlStdOperatorTable.LESS_THAN, ckRef, cRef), unknownLiteral, falseLiteral); return rexBuilder.makeCall( nullableBooleanType,
protected RexNode makeDivide( RexNode a, RexNode b) { return builder.makeCall( SqlStdOperatorTable.DIVIDE_INTEGER, a, b); }
leftRowType.getFieldList().size() + rightField.getIndex()); RexNode equalsCall = rexBuilder.makeCall( SqlStdOperatorTable.EQUALS, left,
protected RexNode makeCase( RexNode condition, RexNode thenClause, RexNode elseClause) { return builder.makeCall( SqlStdOperatorTable.CASE, condition, thenClause, elseClause); }
protected RexNode makeCase( RexNode condition, RexNode thenClause, RexNode elseClause) { return builder.makeCall( SqlStdOperatorTable.caseOperator, condition, thenClause, elseClause); }
protected RexNode makeMultiply( RexNode a, RexNode b) { return builder.makeCall( SqlStdOperatorTable.multiplyOperator, a, b); }
rexBuilder.makeCall( SqlStdOperatorTable.IS_NOT_NULL, fieldAccess);
rexBuilder.makeCall( histogramType, histogramOp,
protected RexNode makeIsPositive( RexNode a) { return builder.makeCall( SqlStdOperatorTable.GREATER_THAN, a, makeExactLiteral(0)); }
if (isNotIn) { subQuery.expr = rexBuilder.makeCall(SqlStdOperatorTable.NOT, subQuery.expr);
private RexNode makeCastExactToBoolean(RelDataType toType, RexNode exp) { return makeCall( toType, SqlStdOperatorTable.notEqualsOperator, ImmutableList.<RexNode>of( exp, makeZeroLiteral(exp.getType()))); }
public RexNode apply(Integer i) { return rexBuilder.makeCall( SqlStdOperatorTable.EQUALS, leftKeys[i], bb.convertExpression( call.getOperands()[i])); } }),
@Test public void testSimpleAnd() { RexNode node = rexBuilder.makeCall( SqlStdOperatorTable.AND, x, y); check( Boolean.FALSE, node, "AND(AND(IS NOT NULL($0), IS NOT NULL($1)), AND($0, $1))"); }
@Test public void testSimpleNotEquals() { RexNode node = rexBuilder.makeCall( SqlStdOperatorTable.NOT_EQUALS, x, y); check( Boolean.FALSE, node, "AND(AND(IS NOT NULL($0), IS NOT NULL($1)), <>($0, $1))"); }
@Test public void testSimpleGreaterThan() { RexNode node = rexBuilder.makeCall( SqlStdOperatorTable.greaterThanOperator, x, y); check( Boolean.TRUE, node, "AND(AND(IS NOT NULL($0), IS NOT NULL($1)), >($0, $1))"); }
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)); }
@Test public void testNonBooleans() { RexNode node = rexBuilder.makeCall( SqlStdOperatorTable.plusOperator, x, y); String expected = node.toString(); check(Boolean.TRUE, node, expected); check(Boolean.FALSE, node, expected); check(null, node, expected); }