viirya commented on a change in pull request #34025: URL: https://github.com/apache/spark/pull/34025#discussion_r710447019
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala ########## @@ -559,6 +559,42 @@ object StructType extends AbstractDataType { case _ => dt } + /** + * This works a little similarly to `merge`, but it does not actually merge two DataTypes. + * This method just merges nullability. + */ + private[sql] def mergeNullability(left: DataType, right: DataType): DataType = + (left, right) match { + case (ArrayType(leftElementType, leftContainsNull), + ArrayType(rightElementType, rightContainsNull)) => + ArrayType( + merge(leftElementType, rightElementType), + leftContainsNull || rightContainsNull) + + case (MapType(leftKeyType, leftValueType, leftContainsNull), + MapType(rightKeyType, rightValueType, rightContainsNull)) => + MapType( + merge(leftKeyType, rightKeyType), + merge(leftValueType, rightValueType), Review comment: Oops, missed it. Thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org