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

    https://github.com/apache/spark/pull/1346#discussion_r14904749
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -102,15 +128,23 @@ class SQLContext(@transient val sparkContext: 
SparkContext)
        *
        * @group userf
        */
    -  def jsonFile(path: String): SchemaRDD = jsonFile(path, 1.0)
    +  def jsonFile(path: String): SchemaRDD = jsonFile(path, 1.0, None)
    +
    +  /**
    +   * Loads a JSON file (one object per line) and applies the given schema,
    +   * returning the result as a [[SchemaRDD]].
    +   *
    +   * @group userf
    +   */
    +  def jsonFile(path: String, schema: StructType): SchemaRDD = 
jsonFile(path, 1.0, Option(schema))
     
       /**
        * :: Experimental ::
        */
       @Experimental
    -  def jsonFile(path: String, samplingRatio: Double): SchemaRDD = {
    +  def jsonFile(path: String, samplingRatio: Double, schema: 
Option[StructType]): SchemaRDD = {
    --- End diff --
    
    We need to be careful here to avoid removing old API functions if we don't 
have to (i.e. I think we are dropping `jsonFile(path, sampling)`.  Furthermore, 
just using default arguments is not enough to preserve binary compatibility.  
    
    Also, when would you ever want to specify both the samplingRatio and a 
schema?


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

Reply via email to