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/03 07:49:40 UTC
[GitHub] [spark] zheniantoushipashi opened a new pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
zheniantoushipashi opened a new pull request #33201:
URL: https://github.com/apache/spark/pull/33201
### What changes were proposed in this pull request?
The canCast method of type of char/varchar is modified to be consistent with StringType
the method cast will change the type char/varchar to StringType
def cast(to: DataType): Column = withExpr {
val cast = Cast(expr, CharVarcharUtils.replaceCharVarcharWithStringForCast(to))
cast.setTagValue(Cast.USER_SPECIFIED_CAST, true)
cast
}
The canCast method of type of char/varchar must be consistent with StringType
### Why are the changes needed?
Before I used stringType instead of char/varchar, my application code has the logic to judge using canCast. There was no problem before, but now it’s changed to char/varchar, and the judgment of canCast fails. If it doesn’t pass, I Need to change a lot of application code
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
i add UT。
--
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
[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
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683337847
##########
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:
> I think people call the Cast.canCast method to use cast for the next step.
I don't think this is common. At least this is not recommended. `Cast` is private and if you must use it, please follow the internal assumptions of Spark.
Inside Spark, the input of `Cast.canCast` can never be char/varchar. Please follow this internal assumption if you want to use this private API. I can also add an assert there to make it clearer.
You can call `replaceCharVarcharWithStringForCast` before calling `Cast.canCas`, in your application code.
--
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683499284
##########
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:
I can help to add this assert to prevent misuse by others, if you mean that char/varchar cannot be used in the cancast method
@cloud-fan
--
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683493485
##########
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:
ok
--
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
[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
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683251479
##########
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:
If you want to use these private Spark APIs (`Cast` is private), you should also follow these internal assumptions and call `replaceCharVarcharWithStringForCast` before dealing with data types.
I don't see why `Cast.canCast` should match `Column.cast`. They are totally different things. One is a low-level util function which is used internally inside Spark, the other is a public user-facing API.
--
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
[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
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683234940
##########
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:
the method cast will change the type char/varchar to StringType, so cast method allows conversion from other types to CHAR/VARCHAR, although a warn message is printed.


in my application code, I first use the canCast method to determine whether the type conversion can be performed before calling the cast method for conversion。
**i think the canCast method muse be consistent with Cast method**
@cloud-fan
--
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683287219
##########
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:
I think people call the Cast.canCast method to use cast for the next step. Since the cast method internally converts from CHAR/VARCHAR type to StringType by default, then I think the canCast method should also convert CHAR/VARCHAR like StringType
@cloud-fan
--
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
[GitHub] [spark] zheniantoushipashi commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-873554397
@HyukjinKwon
I think it only affects
the canCast method of object Cast, the method cast will change the type char/varchar to StringType, so i think the canCast method of type of char/varchar must be consistent with StringType
--
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683234940
##########
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:
the method cast will change the type char/varchar to StringType, so cast method allows conversion from other types to CHAR/VARCHAR, although a warn message is printed.


in my application code, I first use the canCast method to determine whether the type conversion can be performed before calling the cast method for conversion。
**i think the canCast method muse be consistent with Cast method**
@cloud-fan
##########
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:
in my application code, I bring this commit, and rebuid and test, all ut and end-to-end test is passed, I'm working on upgrading spark from 2.4.1 to 3.1.1, which Kylin Enterprise Edition depends on
@cloud-fan
##########
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:
I think people call the Cast.canCast method to use cast for the next step. Since the cast method internally converts from CHAR/VARCHAR type to StringType by default, then I think the canCast method should also convert CHAR/VARCHAR like StringType
@cloud-fan
--
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
[GitHub] [spark] zheniantoushipashi commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-873556679
@HyukjinKwon Only affect the rule of ResolvePivot in Analyzer, the others have no effect
--
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
[GitHub] [spark] github-actions[bot] closed pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #33201:
URL: https://github.com/apache/spark/pull/33201
--
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
[GitHub] [spark] github-actions[bot] commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-968179045
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
--
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
[GitHub] [spark] zheniantoushipashi edited a comment on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi edited a comment on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-873556679
@HyukjinKwon Only affect the rule of ResolvePivot in Analyzer, It only affects the ResolvePivot in the Analyzer, the others especially user-facing behaviour have no effect
--
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
[GitHub] [spark] HyukjinKwon 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
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r678899424
##########
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:
hey sorry but I can't follow why we should fix this here. char and varchars are not supposed to be directly used in these expressions
--
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
[GitHub] [spark] zheniantoushipashi commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-888852446
@HyukjinKwon
--
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
[GitHub] [spark] HyukjinKwon 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
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r678899566
##########
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:
cc @cloud-fan and @yaooqinn.
--
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
[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
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683251479
##########
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:
If you want to use these private Spark APIs (`Cast` is private), you should also follow these internal assumptions and call `replaceCharVarcharWithStringForCast` before dealing with data types.
I don't see why `Cast.canCast` should match `Column.cast`. They are totally different things. One is a low-level util function which is used internally inside Spark, the other is a public user-facing API.
##########
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:
> I think people call the Cast.canCast method to use cast for the next step.
I don't think this is common. At least this is not recommended. `Cast` is private and if you must use it, please follow the internal assumptions of Spark.
Inside Spark, the input of `Cast.canCast` can never be char/varchar. Please follow this internal assumption if you want to use this private API. I can also add an assert there to make it clearer.
You can call `replaceCharVarcharWithStringForCast` before calling `Cast.canCas`, in your application code.
--
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
[GitHub] [spark] AmplabJenkins commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-873364769
Can one of the admins verify this patch?
--
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
[GitHub] [spark] zheniantoushipashi 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
Posted by GitBox <gi...@apache.org>.
zheniantoushipashi commented on a change in pull request #33201:
URL: https://github.com/apache/spark/pull/33201#discussion_r683242315
##########
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:
in my application code, I bring this commit, and rebuid and test, all ut and end-to-end test is passed, I'm working on upgrading spark from 2.4.1 to 3.1.1, which Kylin Enterprise Edition depends on
@cloud-fan
--
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
[GitHub] [spark] HyukjinKwon commented on pull request #33201: [SPARK-36005][SQL] The canCast method of type of char/varchar is modified to be consistent with StringType
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #33201:
URL: https://github.com/apache/spark/pull/33201#issuecomment-873498125
@zheniantoushipashi does it cause any user-facing behaviour change?
--
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