cloud-fan commented on a change in pull request #31859:
URL: https://github.com/apache/spark/pull/31859#discussion_r600213562



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercionSuite.scala
##########
@@ -377,10 +368,31 @@ class AnsiTypeCoercionSuite extends AnalysisTest {
       ArrayType(StringType, true),
       TypeCollection(ArrayType(StringType), StringType),
       ArrayType(StringType, true))
+
+    // When there are multiple convertible types in the `TypeCollection`, use 
the closet convertible
+    // data type among convertible types.
+    shouldCast(IntegerType, TypeCollection(BinaryType, FloatType, LongType), 
LongType)
+    shouldCast(IntegerType, TypeCollection(BinaryType, LongType, NumericType), 
IntegerType)

Review comment:
       This doesn't go to the code path to pick the closest convertible type. 
This hits `case _ if expectedType.acceptsType(inType) => Some(inType)`




-- 
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.

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