public RelDataType createTypeWithNullability( final RelDataType type, final boolean nullable) { Objects.requireNonNull(type); RelDataType newType; if (type.isNullable() == nullable) { newType = type; } else if (type instanceof RelRecordType) { // REVIEW: angel 18-Aug-2005 dtbug 336 workaround // Changed to ignore nullable parameter if nullable is false since // copyRecordType implementation is doubtful if (nullable) { // Do a deep copy, setting all fields of the record type // to be nullable regardless of initial nullability newType = copyRecordType((RelRecordType) type, false, true); } else { // Keep same type as before, ignore nullable parameter // RelRecordType currently always returns a nullability of false newType = copyRecordType((RelRecordType) type, true, false); } } else { newType = copySimpleType(type, nullable); } return canonize(newType); }
public RelDataType createTypeWithNullability( final RelDataType type, final boolean nullable) { Objects.requireNonNull(type); RelDataType newType; if (type.isNullable() == nullable) { newType = type; } else if (type instanceof RelRecordType) { // REVIEW: angel 18-Aug-2005 dtbug 336 workaround // Changed to ignore nullable parameter if nullable is false since // copyRecordType implementation is doubtful if (nullable) { // Do a deep copy, setting all fields of the record type // to be nullable regardless of initial nullability newType = copyRecordType((RelRecordType) type, false, true); } else { // Keep same type as before, ignore nullable parameter // RelRecordType currently always returns a nullability of false newType = copyRecordType((RelRecordType) type, true, false); } } else { newType = copySimpleType(type, nullable); } return canonize(newType); }