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

    https://github.com/apache/spark/pull/5801#discussion_r29782795
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala ---
    @@ -101,32 +103,87 @@ private[sql] class DefaultSource
       }
     }
     
    -private[sql] case class JSONRelation(
    -    path: String,
    -    samplingRatio: Double,
    +private[sql] class JSONRelation(
    +    // baseRDD is not immutable with respect to INSERT OVERWRITE
    +    // and so it must be recreated at least as often as the
    +    // underlying inputs are modified. To be safe, a call-by-name
    +    // value (a function) is used instead of a regular value to
    +    // ensure the RDD is recreated on each and every operation.
    +    baseRDD: => RDD[String],
    --- End diff --
    
    @NathanHowell Do you think a closure at here will be better (as mentioned 
in https://github.com/databricks/scala-style-guide#call_by_name)?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to