@Override public Void visitCall(RexCall call) { if (call.getOperator() == RexBuilder.GET_OPERATOR) { throw Util.FoundOne.NULL; } return super.visitCall(call); } });
/** * Determines whether a RexNode corresponds to a subquery that's been * converted to a constant. * * @param rex the expression to be examined * @return true if the expression is a dynamic parameter, a literal, or * a literal that is being cast */ private boolean isConvertedSubq(RexNode rex) { if ((rex instanceof RexLiteral) || (rex instanceof RexDynamicParam)) { return true; } if (rex instanceof RexCall) { RexCall call = (RexCall) rex; if (call.getOperator() == SqlStdOperatorTable.CAST) { RexNode operand = call.getOperands().get(0); if (operand instanceof RexLiteral) { return true; } } } return false; }
/** * Returns whether a {@link RexNode node} is a {@link RexCall call} to a * given {@link SqlOperator operator}. */ public static boolean isCallTo(RexNode expr, SqlOperator op) { return (expr instanceof RexCall) && (((RexCall) expr).getOperator() == op); }
/** * Returns whether a {@link RexNode node} is a {@link RexCall call} to a * given {@link SqlOperator operator}. */ public static boolean isCallTo(RexNode expr, SqlOperator op) { return (expr instanceof RexCall) && (((RexCall) expr).getOperator() == op); }
public RexExpander getExpander(RexCall call) { RexExpander expander = map.get(call.getOperator()); return (expander != null) ? expander : defaultExpander; } }
public RexExpander getExpander(RexCall call) { RexExpander expander = map.get(call.getOperator()); return (expander != null) ? expander : defaultExpander; } }
public RexNode visitCall(RexCall call) { final SqlOperator op = call.getOperator(); if (!(op instanceof SqlAggFunction)) { return super.visitCall(call);
public Void visitCall(RexCall call) { ++totalCount; if (MULTISET_OPERATORS.contains(call.getOperator())) { if (!call.getOperator().equals(SqlStdOperatorTable.CAST) || isMultisetCast(call)) { ++multisetCount; } } return super.visitCall(call); } }
/** Translates a call to an operator or function. */ private Expression translateCall(RexCall call, RexImpTable.NullAs nullAs) { final SqlOperator operator = call.getOperator(); CallImplementor implementor = RexImpTable.INSTANCE.get(operator); if (implementor == null) { throw new RuntimeException("cannot translate call " + call); } return implementor.implement(this, call, nullAs); }
private static void flattenRecurse( List<RexNode> list, List<? extends RexNode> exprs, SqlOperator op) { for (RexNode expr : exprs) { if (expr instanceof RexCall && ((RexCall) expr).getOperator() == op) { flattenRecurse(list, ((RexCall) expr).getOperands(), op); } else { list.add(expr); } } }
private boolean isConstructor(RexNode rexNode) { // TODO jvs 11-Feb-2005: share code with SqlToRelConverter if (!(rexNode instanceof RexCall)) { return false; } RexCall call = (RexCall) rexNode; return call.getOperator().getName().equalsIgnoreCase("row") || (call.isA(RexKind.NewSpecification)); }
public Void visitCall(RexCall call) { CallConvertlet convertlet = convertletMap.get(call.getOperator()); if (convertlet == null) { failed = true; return null; } // visit operands first super.visitCall(call); convertlet.convert(call); return null; }
public Void visitCall(RexCall call) { CallConvertlet convertlet = convertletMap.get(call.getOperator()); if (convertlet == null) { failed = true; return null; } // visit operands first super.visitCall(call); convertlet.convert(call); return null; }
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; }
private boolean isTransformable(RexNode node) { if (0 == isParentsCount) { return false; } if (node instanceof RexCall) { RexCall call = (RexCall) node; return !transformableOperators.contains( call.getOperator()) && isNullable(node); } return isNullable(node); }
public Void visitCall(RexCall call) { if (call.getOperator().equals(operator)) { throw new Util.FoundOne(call); } return super.visitCall(call); } };
@Override public RexNode visitCall(RexCall call) { if (call.getOperator() == RexBuilder.GET_OPERATOR) { final String name = (String) ((RexLiteral) call.getOperands().get(1)).getValue2(); final int i = lookup(fields, name); if (i >= 0) { return RexInputRef.of(i, fields); } } return super.visitCall(call); }
/** * Returns false if the expression can be optimized by flattening * calls to an associative operator such as AND and OR. */ public static boolean isFlat(RexNode expr) { if (!(expr instanceof RexCall)) { return true; } final RexCall call = (RexCall) expr; return isFlat(call.getOperands(), call.getOperator()) && all(call.getOperands(), IS_FLAT_PREDICATE); }
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)); }