cloud-fan commented on code in PR #49340:
URL: https://github.com/apache/spark/pull/49340#discussion_r1903535674


##########
sql/api/src/main/scala/org/apache/spark/sql/types/UpCastRule.scala:
##########
@@ -41,10 +41,9 @@ private[sql] object UpCastRule {
     case (TimestampNTZType, TimestampType) => true
     case (TimestampType, TimestampNTZType) => true
 
-    case (_: AtomicType, CharType(_) | VarcharType(_)) => false
-    case (_: CalendarIntervalType, CharType(_) | VarcharType(_)) => false
-    case (_: AtomicType, _: StringType) => true
-    case (_: CalendarIntervalType, _: StringType) => true
+    case (s1: StringType, s2: StringType) => 
StringHelper.isMoreConstrained(s1, s2)

Review Comment:
   shall we allow cast varchar(10) to varchar(5) since it's possible that all 
the actual string values do not exceed length 5?



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

Reply via email to