cloud-fan commented on code in PR #49340: URL: https://github.com/apache/spark/pull/49340#discussion_r1903562685
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala: ########## @@ -318,10 +320,9 @@ object Cast extends QueryErrorsBase { case _ if from == to => true case (NullType, _) => true case (_: NumericType, _: NumericType) => true - case (_: AtomicType, CharType(_) | VarcharType(_)) => false - case (_: CalendarIntervalType, CharType(_) | VarcharType(_)) => false - case (_: AtomicType, _: StringType) => true - case (_: CalendarIntervalType, _: StringType) => true + case (_: StringType, _: StringType) => true + case (_: AtomicType, s: StringType) if StringHelper.isPlainString(s) => true Review Comment: I'm wondering if it's better and more efficient to allow casting from atomic type to any string type. Then we don't need two back to back casts for it. -- 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