sarutak commented on a change in pull request #32203:
URL: https://github.com/apache/spark/pull/32203#discussion_r614606086



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonGenerator.scala
##########
@@ -73,7 +74,7 @@ private[sql] class JacksonGenerator(
 
   private val gen = {
     val generator = new 
JsonFactory().createGenerator(writer).setRootValueSeparator(null)
-    if (options.pretty) generator.useDefaultPrettyPrinter() else generator

Review comment:
       Of course I read the doc but the actually returned instance is not 
equivalent to the instance created by `new DefaultPrettyPrinter("")`.
   
https://github.com/FasterXML/jackson-core/blob/jackson-core-2.12.2/src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java#L452
   
   The parameter of the constructor is the separator which separate multiple 
root JSON records and the default separator character is `" "`.
   
https://github.com/FasterXML/jackson-core/blob/jackson-core-2.12.2/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java#L101
   
https://github.com/FasterXML/jackson-core/blob/jackson-core-2.12.2/src/main/java/com/fasterxml/jackson/core/util/DefaultPrettyPrinter.java#L28




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

Reply via email to