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)); } }
return translateLiteral( (RexLiteral) expr, nullifyType( expr.getType(), isNullable(expr)
return translateLiteral( (RexLiteral) expr, nullifyType( expr.getType(), isNullable(expr)