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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -406,19 +406,21 @@ abstract class CastBase extends UnaryExpression with 
TimeZoneAwareExpression wit
         if (row.numFields > 0) {
           val st = fields.map(_.dataType)
           val toUTF8StringFuncs = st.map(castToString)
-          if (row.isNullAt(0)) {
+          if (fields(0).nullable && row.isNullAt(0)) {

Review comment:
       if `fields(0).nullable` is false, how can `row.isNullAt(0)` be true?




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