public static boolean isComparisonOp(RexCall call) { return call.getKind().belongsTo(SqlKind.COMPARISON); }
public static boolean isComparisonOp(RexCall call) { return call.getKind().belongsTo(SqlKind.COMPARISON); }
public static CompareTupleFilter.CompareResultType getCompareResultType(RexCall whenCall) { List<RexNode> operands = whenCall.getOperands(); if (SqlKind.EQUALS == whenCall.getKind() && operands != null && operands.size() == 2) { if (operands.get(0).equals(operands.get(1))) { return CompareTupleFilter.CompareResultType.AlwaysTrue; } if (isConstant(operands.get(0)) && isConstant(operands.get(1))) { return CompareTupleFilter.CompareResultType.AlwaysFalse; } } return CompareTupleFilter.CompareResultType.Unknown; }
@Override public Void visitCall(RexCall call) { if (call.getKind() == SqlKind.AND) { return super.visitCall(call); } else { boolean isValidCall = JDBCRexCallValidator.isValidJdbcOperation(call, dialect); if (isValidCall) { validJdbcNode.add(call); } else { invalidJdbcNode.add(call); } } return null; }
private SqlKind getOp(RexCall call) { SqlKind op = call.getKind(); if (call.getKind().equals(SqlKind.OTHER_FUNCTION) && SqlTypeUtil.inBooleanFamily(call.getType())) { SqlOperator sqlOp = call.getOperator(); String opName = (sqlOp != null) ? sqlOp.getName() : ""; if (opName.equalsIgnoreCase("in")) { op = SqlKind.IN; } } return op; }
private SqlKind getOp(RexCall call) { SqlKind op = call.getKind(); if (call.getKind().equals(SqlKind.OTHER_FUNCTION) && SqlTypeUtil.inBooleanFamily(call.getType())) { SqlOperator sqlOp = call.getOperator(); String opName = (sqlOp != null) ? sqlOp.getName() : ""; if (opName.equalsIgnoreCase("in")) { op = SqlKind.IN; } } return op; }
@Override public RexNode visitCall(RexCall inputCall) { RexNode node = super.visitCall(inputCall); if (node instanceof RexCall) { RexCall call = (RexCall) node; switch (call.getKind()) { case OR: try { RexNode newNode = transformIntoInClauseCondition(rexBuilder, call, minNumORClauses); if (newNode != null) { return newNode; } } catch (SemanticException e) { LOG.error("Exception in HivePointLookupOptimizerRule", e); return call; } default: break; } } return node; }
private boolean isSqlCountCheck(final HiveFilter filter) { // look at hivesubqueryremoverule to see how is this filter created if(filter.getCondition() instanceof RexCall) { final RexCall condition = (RexCall)filter.getCondition(); if(condition.getKind() == SqlKind.LESS_THAN_OR_EQUAL) { final List<RexNode> operands = condition.getOperands(); if(operands.get(0) instanceof RexCall) { final RexCall op = (RexCall)operands.get(0); if(op.getOperator().getName().equals("sq_count_check")) { return true; } } } } return false; }
Map<String,RexNode> stringToExpr = Maps.newHashMap(); Multimap<String,String> inLHSExprToRHSExprs = LinkedHashMultimap.create(); switch (call.getKind()) { case AND:
@Override public RexNode visitCall(RexCall call) { RexNode node; switch (call.getKind()) { case AND: ImmutableList<RexNode> operands = RexUtil.flattenAnd(((RexCall) call).getOperands());
Map<String,RexNode> stringToExpr = Maps.newHashMap(); Multimap<String,String> inLHSExprToRHSExprs = LinkedHashMultimap.create(); switch (call.getKind()) { case AND:
switch (rexCall.getKind()) { case IS_NULL: case IS_UNKNOWN:
switch (rexCall.getKind()) { case IS_NULL: case IS_UNKNOWN:
boolean reverse = false; SqlKind kind = call.getKind();
boolean reverse = false; SqlKind kind = call.getKind();
if (newConditionExp instanceof RexCall) { RexCall rexCall = (RexCall) newConditionExp; boolean reverse = rexCall.getKind() == SqlKind.NOT; if (reverse) { if (!(rexCall.getOperands().get(0) instanceof RexCall)) {
if (newConditionExp instanceof RexCall) { RexCall rexCall = (RexCall) newConditionExp; boolean reverse = rexCall.getKind() == SqlKind.NOT; if (reverse) { if (!(rexCall.getOperands().get(0) instanceof RexCall)) {
/** Creates a binding of the appropriate type. */ public static RexCallBinding create(RelDataTypeFactory typeFactory, RexCall call, List<RelCollation> inputCollations) { switch (call.getKind()) { case CAST: return new RexCastCallBinding(typeFactory, call.getOperator(), call.getOperands(), call.getType(), inputCollations); } return new RexCallBinding(typeFactory, call.getOperator(), call.getOperands(), inputCollations); }