Expression translate(RexNode expr, RexImpTable.NullAs nullAs) { return translate(expr, nullAs, null); }
public Expression implement(RexToLixTranslator translator, RexCall call, NullAs nullAs) { switch (nullAs) { case NULL: return Expressions.call(BuiltInMethod.NOT.method, translator.translateList(call.getOperands(), nullAs)); default: return Expressions.not( translator.translate(call.getOperands().get(0), negate(nullAs))); } }
public Expression implement(RexToLixTranslator translator, RexCall call, NullAs nullAs) { switch (nullAs) { case NULL: return Expressions.call(BuiltInMethod.NOT.method, translator.translateList(call.getOperands(), nullAs)); default: return Expressions.not( translator.translate(call.getOperands().get(0), negate(nullAs))); } }
Expression translate(RexNode expr, RexImpTable.NullAs nullAs) { return translate(expr, nullAs, null); }
private Expression implementRecurse(RexToLixTranslator translator, List<RexNode> operands, NullAs nullAs) { if (operands.size() == 1) { return translator.translate(operands.get(0)); } else { return Expressions.condition( translator.translate(operands.get(0), NullAs.IS_NULL), translator.translate(operands.get(0), nullAs), implementRecurse(translator, Util.skip(operands), nullAs)); } } }
public List<Expression> translateList( List<RexNode> operandList, RexImpTable.NullAs nullAs, List<? extends Type> storageTypes) { final List<Expression> list = new ArrayList<>(); for (Pair<RexNode, ? extends Type> e : Pair.zip(operandList, storageTypes)) { list.add(translate(e.left, nullAs, e.right)); } return list; }
private Expression implementRecurse(RexToLixTranslator translator, List<RexNode> operands, NullAs nullAs) { if (operands.size() == 1) { return translator.translate(operands.get(0)); } else { return Expressions.condition( translator.translate(operands.get(0), NullAs.IS_NULL), translator.translate(operands.get(0), nullAs), implementRecurse(translator, Util.skip(operands), nullAs)); } } }
public List<Expression> translateList( List<RexNode> operandList, RexImpTable.NullAs nullAs, List<? extends Type> storageTypes) { final List<Expression> list = new ArrayList<>(); for (Pair<RexNode, ? extends Type> e : Pair.zip(operandList, storageTypes)) { list.add(translate(e.left, nullAs, e.right)); } return list; }
public Expression implement( RexToLixTranslator translator, RexCall call, NullAs nullAs) { List<RexNode> operands = call.getOperands(); assert operands.size() == 1; if (seek == null) { return translator.translate(operands.get(0), negate ? NullAs.IS_NOT_NULL : NullAs.IS_NULL); } else { return maybeNegate(negate == seek, translator.translate(operands.get(0), seek ? NullAs.FALSE : NullAs.TRUE)); } } }
public Expression implement( RexToLixTranslator translator, RexCall call, NullAs nullAs) { List<RexNode> operands = call.getOperands(); assert operands.size() == 1; if (seek == null) { return translator.translate(operands.get(0), negate ? NullAs.IS_NOT_NULL : NullAs.IS_NULL); } else { return maybeNegate(negate == seek, translator.translate(operands.get(0), seek ? NullAs.FALSE : NullAs.TRUE)); } } }
Expression translate(RexNode expr, Type storageType) { final RexImpTable.NullAs nullAs = RexImpTable.NullAs.of(isNullable(expr)); return translate(expr, nullAs, storageType); }
Expression translate(RexNode expr, Type storageType) { final RexImpTable.NullAs nullAs = RexImpTable.NullAs.of(isNullable(expr)); return translate(expr, nullAs, storageType); }
Expression translate(RexNode expr) { final RexImpTable.NullAs nullAs = RexImpTable.NullAs.of(isNullable(expr)); return translate(expr, nullAs); }
Expression translate(RexNode expr) { final RexImpTable.NullAs nullAs = RexImpTable.NullAs.of(isNullable(expr)); return translate(expr, nullAs); }
public static Expression translateCondition(RexProgram program, JavaTypeFactory typeFactory, BlockBuilder list, InputGetter inputGetter, Function1<String, InputGetter> correlates, SqlConformance conformance) { if (program.getCondition() == null) { return RexImpTable.TRUE_EXPR; } final ParameterExpression root = DataContext.ROOT; RexToLixTranslator translator = new RexToLixTranslator(program, typeFactory, root, inputGetter, list, Collections.emptyMap(), new RexBuilder(typeFactory), conformance, null, null); translator = translator.setCorrelates(correlates); return translator.translate( program.getCondition(), RexImpTable.NullAs.FALSE); }
public static Expression translateCondition(RexProgram program, JavaTypeFactory typeFactory, BlockBuilder list, InputGetter inputGetter, Function1<String, InputGetter> correlates, SqlConformance conformance) { if (program.getCondition() == null) { return RexImpTable.TRUE_EXPR; } final ParameterExpression root = DataContext.ROOT; RexToLixTranslator translator = new RexToLixTranslator(program, typeFactory, root, inputGetter, list, Collections.emptyMap(), new RexBuilder(typeFactory), conformance, null, null); translator = translator.setCorrelates(correlates); return translator.translate( program.getCondition(), RexImpTable.NullAs.FALSE); }
public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; return Expressions.condition(winResult.hasRows(), winResult.rowTranslator( winResult.computeIndex(Expressions.constant(0), seekType)) .translate(winResult.rexArguments().get(0), info.returnType()), getDefaultValue(info.returnType())); } }
public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; return Expressions.condition(winResult.hasRows(), winResult.rowTranslator( winResult.computeIndex(Expressions.constant(0), seekType)) .translate(winResult.rexArguments().get(0), info.returnType()), getDefaultValue(info.returnType())); } }
public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; List<RexNode> rexArgs = winResult.rexArguments(); Expression tiles = winResult.rowTranslator(winResult.index()).translate( rexArgs.get(0), int.class); Expression ntile = Expressions.add(Expressions.constant(1), Expressions.divide( Expressions.multiply( tiles, Expressions.subtract( winResult.index(), winResult.startIndex())), winResult.getPartitionRowCount())); return ntile; } }
public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; List<RexNode> rexArgs = winResult.rexArguments(); Expression tiles = winResult.rowTranslator(winResult.index()).translate( rexArgs.get(0), int.class); Expression ntile = Expressions.add(Expressions.constant(1), Expressions.divide( Expressions.multiply( tiles, Expressions.subtract( winResult.index(), winResult.startIndex())), winResult.getPartitionRowCount())); return ntile; } }