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 2020/11/06 15:00:11 UTC

[GitHub] [spark] stwhit commented on a change in pull request #30189: [SPARK-33291][SQL] Improve DataFrame.show for nulls in arrays and structs

stwhit commented on a change in pull request #30189:
URL: https://github.com/apache/spark/pull/30189#discussion_r518806137



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -898,8 +900,9 @@ abstract class CastBase extends UnaryExpression with TimeZoneAwareExpression wit
     """
   }
 
-  private def outNullElem(buffer: ExprValue): Block = {
-    if (legacyCastToStr) code"" else code"""$buffer.append(" null");"""
+  private def appendIfNotLegacyCastToStr(buffer: ExprValue, s: String): Block = {
+    if (!legacyCastToStr) code"""$buffer.append("$s");"""
+    else EmptyBlock

Review comment:
       I've modified the code per your suggestion.




----------------------------------------------------------------
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:
users@infra.apache.org



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