attilapiros commented on code in PR #53458:
URL: https://github.com/apache/spark/pull/53458#discussion_r2755634418
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:
##########
@@ -626,6 +634,8 @@ case class Cast(
} else {
(child.dataType, dataType) match {
case (_: StringType, BinaryType) => child.nullable
+ // In TRY mode with validation enabled, BinaryType to StringType cast
can return null
+ case (BinaryType, _: StringType) => validateUtf8 || child.nullable
Review Comment:
Does the old `Cast.canUpCast(child.dataType, dataType)` call gave back
`false` always?
So was `child.nullable || !Cast.canUpCast(child.dataType, dataType)` always
`true` independent from ``child.nullable`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]