viirya commented on a change in pull request #30189:
URL: https://github.com/apache/spark/pull/30189#discussion_r518884821
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -982,7 +985,7 @@ abstract class CastBase extends UnaryExpression with
TimeZoneAwareExpression wit
| $buffer.append($keyToStringFunc($getMapFirstKey));
| $buffer.append(" ->");
| if ($map.valueArray().isNullAt(0)) {
- | ${outNullElem(buffer)}
+ | ${appendIfNotLegacyCastToStr(buffer, " null")}
Review comment:
Oh, so map doesn't have the same a leading space? If so then it is okay.
As you actually change map's code, it would be nice to add a test like
array/struct to prevent anything wrong.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]