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); }
if (desiredType == null && !isNullable(rex)) { assert !Primitive.isBox(translate.getType()) : "Not-null boxed primitive should come back as primitive: "
if (desiredType == null && !isNullable(rex)) { assert !Primitive.isBox(translate.getType()) : "Not-null boxed primitive should come back as primitive: "
private static Expression implementCall( final RexToLixTranslator translator, RexCall call, NotNullImplementor implementor, final NullAs nullAs) { List<Expression> translatedOperands = translator.translateList(call.getOperands()); // Make sure the operands marked not null in the translator have all been // handled for nulls before being passed to the NotNullImplementor. if (nullAs == NullAs.NOT_POSSIBLE) { List<Expression> nullHandled = translatedOperands; for (int i = 0; i < translatedOperands.size(); i++) { RexNode arg = call.getOperands().get(i); Expression e = translatedOperands.get(i); if (!translator.isNullable(arg)) { if (nullHandled == translatedOperands) { nullHandled = new ArrayList<>(translatedOperands.subList(0, i)); } nullHandled.add(translator.handleNull(e, nullAs)); } else if (nullHandled != translatedOperands) { nullHandled.add(e); } } translatedOperands = nullHandled; } Expression result = implementor.implement(translator, call, translatedOperands); return translator.handleNull(result, nullAs); }
private static Expression implementCall( final RexToLixTranslator translator, RexCall call, NotNullImplementor implementor, final NullAs nullAs) { List<Expression> translatedOperands = translator.translateList(call.getOperands()); // Make sure the operands marked not null in the translator have all been // handled for nulls before being passed to the NotNullImplementor. if (nullAs == NullAs.NOT_POSSIBLE) { List<Expression> nullHandled = translatedOperands; for (int i = 0; i < translatedOperands.size(); i++) { RexNode arg = call.getOperands().get(i); Expression e = translatedOperands.get(i); if (!translator.isNullable(arg)) { if (nullHandled == translatedOperands) { nullHandled = new ArrayList<>(translatedOperands.subList(0, i)); } nullHandled.add(translator.handleNull(e, nullAs)); } else if (nullHandled != translatedOperands) { nullHandled.add(e); } } translatedOperands = nullHandled; } Expression result = implementor.implement(translator, call, translatedOperands); return translator.handleNull(result, nullAs); }
public Expression implement( RexToLixTranslator translator, RexCall call, List<Expression> translatedOperands) { assert call.getOperands().size() == 1; final RelDataType sourceType = call.getOperands().get(0).getType(); // It's only possible for the result to be null if both expression // and target type are nullable. We assume that the caller did not // make a mistake. If expression looks nullable, caller WILL have // checked that expression is not null before calling us. final boolean nullable = translator.isNullable(call) && sourceType.isNullable() && !Primitive.is(translatedOperands.get(0).getType()); final RelDataType targetType = translator.nullifyType(call.getType(), nullable); return translator.translateCast(sourceType, targetType, translatedOperands.get(0)); } }
public Expression implement( RexToLixTranslator translator, RexCall call, List<Expression> translatedOperands) { assert call.getOperands().size() == 1; final RelDataType sourceType = call.getOperands().get(0).getType(); // It's only possible for the result to be null if both expression // and target type are nullable. We assume that the caller did not // make a mistake. If expression looks nullable, caller WILL have // checked that expression is not null before calling us. final boolean nullable = translator.isNullable(call) && sourceType.isNullable() && !Primitive.is(translatedOperands.get(0).getType()); final RelDataType targetType = translator.nullifyType(call.getType(), nullable); return translator.translateCast(sourceType, targetType, translatedOperands.get(0)); } }
RelDataType type = operand.getType(); type = toSql(typeFactory, type); if (translator.isNullable(operand)) { ++nullCount; } else {
RelDataType type = operand.getType(); type = toSql(typeFactory, type); if (translator.isNullable(operand)) { ++nullCount; } else {
if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(arg) && !nullable.containsKey(arg)) { nullable.put(arg, false);
if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(operand.e)) { list.add( translator.translate( if (translator.isNullable(arg) && !nullable.containsKey(arg)) { nullable.put(arg, false);
if (translator.isNullable(arg)) { nullables.put(arg, false);
nullifyType( expr.getType(), isNullable(expr) && nullAs != RexImpTable.NullAs.NOT_POSSIBLE), typeFactory,
if (translator.isNullable(arg)) { nullables.put(arg, false);
nullifyType( expr.getType(), isNullable(expr) && nullAs != RexImpTable.NullAs.NOT_POSSIBLE), typeFactory,