/** * Returns whether one or more of an array of types is nullable. */ public static boolean containsNullable(List<RelDataType> types) { for (RelDataType type : types) { if (containsNullable(type)) { return true; } } return false; }
/** * Returns whether one or more of an array of types is nullable. */ public static boolean containsNullable(List<RelDataType> types) { for (RelDataType type : types) { if (containsNullable(type)) { return true; } } return false; }
/** * Returns whether all of array of types are nullable. */ public static boolean allNullable(List<RelDataType> types) { for (RelDataType type : types) { if (!containsNullable(type)) { return false; } } return true; }
/** * Returns whether one or more of an array of types is nullable. */ public static boolean containsNullable(List<RelDataType> types) { for (RelDataType type : types) { if (containsNullable(type)) { return true; } } return false; }
/** * Returns whether all of array of types are nullable. */ public static boolean allNullable(List<RelDataType> types) { for (RelDataType type : types) { if (!containsNullable(type)) { return false; } } return true; }
/** * Returns whether all of array of types are nullable. */ public static boolean allNullable(List<RelDataType> types) { for (RelDataType type : types) { if (!containsNullable(type)) { return false; } } return true; }
/** * Recreates a given RelDataType with nullability iff any of the param * argTypes are nullable. */ public static RelDataType makeNullableIfOperandsAre( final RelDataTypeFactory typeFactory, final List<RelDataType> argTypes, RelDataType type) { Objects.requireNonNull(type); if (containsNullable(argTypes)) { type = typeFactory.createTypeWithNullability(type, true); } return type; }
/** * Recreates a given RelDataType with nullability iff any of the param * argTypes are nullable. */ public static RelDataType makeNullableIfOperandsAre( final RelDataTypeFactory typeFactory, final List<RelDataType> argTypes, RelDataType type) { Preconditions.checkNotNull(type); if (containsNullable(argTypes)) { type = typeFactory.createTypeWithNullability(type, true); } return type; }
/** * Recreates a given RelDataType with nullability iff any of the param * argTypes are nullable. */ public static RelDataType makeNullableIfOperandsAre( final RelDataTypeFactory typeFactory, final List<RelDataType> argTypes, RelDataType type) { Objects.requireNonNull(type); if (containsNullable(argTypes)) { type = typeFactory.createTypeWithNullability(type, true); } return type; }
/** * Determines whether a type or any of its fields (if a structured type) are * nullable. */ public static boolean containsNullable(RelDataType type) { if (type.isNullable()) { return true; } if (!type.isStruct()) { return false; } for (RelDataTypeField field : type.getFieldList()) { if (containsNullable(field.getType())) { return true; } } return false; }
/** * Determines whether a type or any of its fields (if a structured type) are * nullable. */ public static boolean containsNullable(RelDataType type) { if (type.isNullable()) { return true; } if (!type.isStruct()) { return false; } for (RelDataTypeField field : type.getFieldList()) { if (containsNullable(field.getType())) { return true; } } return false; }
/** * Determines whether a type or any of its fields (if a structured type) are * nullable. */ public static boolean containsNullable(RelDataType type) { if (type.isNullable()) { return true; } if (!type.isStruct()) { return false; } for (RelDataTypeField field : type.getFieldList()) { if (containsNullable(field.getType())) { return true; } } return false; }
/** * Recreates a given RelDataType with nullability iff any of the operands * of a call are nullable. */ public static RelDataType makeNullableIfOperandsAre( final SqlValidator validator, final SqlValidatorScope scope, final SqlCall call, RelDataType type) { for (SqlNode operand : call.getOperandList()) { RelDataType operandType = validator.deriveType(scope, operand); if (containsNullable(operandType)) { RelDataTypeFactory typeFactory = validator.getTypeFactory(); type = typeFactory.createTypeWithNullability(type, true); break; } } return type; }
/** * Recreates a given RelDataType with nullability iff any of the operands * of a call are nullable. */ public static RelDataType makeNullableIfOperandsAre( final SqlValidator validator, final SqlValidatorScope scope, final SqlCall call, RelDataType type) { for (SqlNode operand : call.getOperandList()) { RelDataType operandType = validator.deriveType(scope, operand); if (containsNullable(operandType)) { RelDataTypeFactory typeFactory = validator.getTypeFactory(); type = typeFactory.createTypeWithNullability(type, true); break; } } return type; }
/** * Recreates a given RelDataType with nullability iff any of the operands * of a call are nullable. */ public static RelDataType makeNullableIfOperandsAre( final SqlValidator validator, final SqlValidatorScope scope, final SqlCall call, RelDataType type) { for (SqlNode operand : call.getOperandList()) { RelDataType operandType = validator.deriveType(scope, operand); if (containsNullable(operandType)) { RelDataTypeFactory typeFactory = validator.getTypeFactory(); type = typeFactory.createTypeWithNullability(type, true); break; } } return type; }
cx.getTypeFactory().createTypeWithNullability( cx.getTypeFactory().createSqlType(sqlTypeName), SqlTypeUtil.containsNullable(rexCall.getType())); RexNode e = rexBuilder.makeCast(intType, rexCall); return rexBuilder.multiplyDivide(e, multiplier, divider);
cx.getTypeFactory().createTypeWithNullability( cx.getTypeFactory().createSqlType(sqlTypeName), SqlTypeUtil.containsNullable(rexCall.getType())); RexNode e = rexBuilder.makeCast(intType, rexCall); return rexBuilder.multiplyDivide(e, multiplier, divider);