gengliangwang commented on code in PR #45612:
URL: https://github.com/apache/spark/pull/45612#discussion_r1532752250


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala:
##########
@@ -180,37 +180,18 @@ object AnsiTypeCoercion extends TypeCoercionBase {
       // cast the input to decimal.
       case (n: NumericType, DecimalType) => Some(DecimalType.forType(n))
 
-      // Cast null type (usually from null literals) into target types
-      // By default, the result type is `target.defaultConcreteType`. When the 
target type is
-      // `TypeCollection`, there is another branch to find the "closet 
convertible data type" below.
-      case (NullType, target) if !target.isInstanceOf[TypeCollection] =>

Review Comment:
   ```
         case (_, target: DataType) =>
           if (Cast.canANSIStoreAssign(inType, target)) {
             Some(target)
           } else {
             None
           }
   ```
   
   There seems to be some differences between returning `target` and 
`target.defaultConcreteType`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to