assert literalExpr.isA(SqlKind.CAST); RexNode child = ((RexCall) literalExpr).getOperands().get(0); assert RexLiteral.isNullLiteral(child);
/** * Decompose a rex predicate into list of RexNodes that are AND'ed together * * @param rexPredicate predicate to be analyzed * @param rexList list of decomposed RexNodes */ public static void decomposeConjunction( RexNode rexPredicate, List<RexNode> rexList) { if (rexPredicate == null || rexPredicate.isAlwaysTrue()) { return; } if (rexPredicate.isA(RexKind.And)) { for (RexNode operand : ((RexCall) rexPredicate).getOperands()) { decomposeConjunction(operand, rexList); } } else { rexList.add(rexPredicate); } }
/** * Decomposes a predicate into a list of expressions that are OR'ed * together. * * @param rexPredicate predicate to be analyzed * @param rexList list of decomposed RexNodes */ public static void decomposeDisjunction( RexNode rexPredicate, List<RexNode> rexList) { if (rexPredicate == null || rexPredicate.isAlwaysFalse()) { return; } if (rexPredicate.isA(SqlKind.OR)) { for (RexNode operand : ((RexCall) rexPredicate).getOperands()) { decomposeDisjunction(operand, rexList); } } else { rexList.add(rexPredicate); } }
/** * Decomposes a predicate into a list of expressions that are AND'ed * together. * * @param rexPredicate predicate to be analyzed * @param rexList list of decomposed RexNodes */ public static void decomposeConjunction( RexNode rexPredicate, List<RexNode> rexList) { if (rexPredicate == null || rexPredicate.isAlwaysTrue()) { return; } if (rexPredicate.isA(SqlKind.AND)) { for (RexNode operand : ((RexCall) rexPredicate).getOperands()) { decomposeConjunction(operand, rexList); } } else { rexList.add(rexPredicate); } }
public boolean canExpand(RexCall call) { return call.isA(RexKind.Reinterpret) && call.operands.get(0).isA(RexKind.Reinterpret); }
public boolean canExpand(RexCall call) { return call.isA(SqlKind.REINTERPRET) && call.operands.get(0).isA(SqlKind.REINTERPRET); }
if (node.isA(SqlKind.CAST)) { RexCall call = (RexCall) node; if (isNullLiteral(call.operands.get(0), false)) {
if (node.isA(RexKind.Cast)) { RexCall call = (RexCall) node; if (isNullLiteral(call.operands.get(0), false)) {
continue; if (!joinFilter.isA(SqlKind.COMPARISON)) { continue;
if (condition.isA(SqlKind.AND)) { List<RexNode> operands = call.getOperands(); RexNode left =
flattenedFieldNames.add(fieldName); } else if (isConstructor(exp) || exp.isA(SqlKind.CAST)) { if (exp.isA(SqlKind.NEW_SPECIFICATION)) { rexBuilder.makeLiteral(false)); flattenedFieldNames.add(fieldName); } else if (exp.isA(SqlKind.CAST)) { if (RexLiteral.isNullLiteral( ((RexCall) exp).operands.get(0))) {
/** * Returns a permutation describing where output fields come from. In * the returned map, value of {@code map.getTargetOpt(i)} is {@code n} if * field {@code i} projects input field {@code n}, -1 if it is an * expression. */ public static Mappings.TargetMapping permutation( List<RexNode> nodes, RelDataType inputRowType) { final Mappings.TargetMapping mapping = Mappings.create( MappingType.PARTIAL_FUNCTION, nodes.size(), inputRowType.getFieldCount()); for (Ord<RexNode> node : Ord.zip(nodes)) { if (node.e instanceof RexInputRef) { mapping.set( node.i, ((RexInputRef) node.e).getIndex()); } else if (node.e.isA(SqlKind.CAST)) { RexNode operand = ((RexCall) node.e).getOperands().get(0); if (operand instanceof RexInputRef) { mapping.set( node.i, ((RexInputRef) operand).getIndex()); } } } return mapping; }
flattenedFieldNames.add(fieldName); } else if (isConstructor(exp) || exp.isA(RexKind.Cast)) { if (exp.isA(RexKind.NewSpecification)) { rexBuilder.makeLiteral(false)); flattenedFieldNames.add(fieldName); } else if (exp.isA(RexKind.Cast)) { if (RexLiteral.isNullLiteral( ((RexCall) exp).operands.get(0)))
assert (literalExpr.isA(RexKind.Cast)); RexNode child = ((RexCall) literalExpr).getOperands().get(0); assert RexLiteral.isNullLiteral(child);
assert literalExpr.isA(SqlKind.CAST); RexNode child = ((RexCall) literalExpr).getOperands().get(0); assert RexLiteral.isNullLiteral(child);