Github user robert3005 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14615#discussion_r74788858
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala
 ---
    @@ -84,7 +84,7 @@ class JsonFileFormat extends TextBasedFileFormat with 
DataSourceRegister {
               bucketId: Option[Int],
               dataSchema: StructType,
               context: TaskAttemptContext): OutputWriter = {
    -        new JsonOutputWriter(path, bucketId, dataSchema, context)
    +        new JsonOutputWriter(path, bucketId, new 
JacksonGenerator(dataSchema)(_), context)
    --- End diff --
    
    I thought it made more sense to apply the schema early since it's immutable 
over whole dataset while the writer is per partition. As you see in the 
JsonOutputWriter the writer is applied there. Not sure if this makes difference 
from perf point but it makes structure clearer (at least in my mind)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to