You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/29 08:59:28 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -54,38 +54,38 @@ object Cast {
 
     case (NullType, _) => true
 
-    case (_, StringType) => true
+    case (_, StringType | CharType(_) | VarcharType(_)) => true

Review comment:
       Do you have an end-to-end test? char/varchar type is carefully handled and they will be replaced with string type at the very beginning. We should not hit char/varchar type.

##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -54,38 +54,38 @@ object Cast {
 
     case (NullType, _) => true
 
-    case (_, StringType) => true
+    case (_, StringType | CharType(_) | VarcharType(_)) => true

Review comment:
       Do you have an end-to-end test? char/varchar type is carefully handled and they will be replaced with string type at the very beginning. We should not hit char/varchar type here.




-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org