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

    https://github.com/apache/spark/pull/3431#discussion_r21939724
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala ---
    @@ -18,31 +18,38 @@
     package org.apache.spark.sql.json
     
     import org.apache.spark.sql.SQLContext
    +import org.apache.spark.sql.catalyst.types.StructType
     import org.apache.spark.sql.sources._
     
     private[sql] class DefaultSource extends RelationProvider {
       /** Returns a new base relation with the given parameters. */
       override def createRelation(
           sqlContext: SQLContext,
    -      parameters: Map[String, String]): BaseRelation = {
    +      parameters: Map[String, String],
    +      schema: Option[StructType]): BaseRelation = {
         val fileName = parameters.getOrElse("path", sys.error("Option 'path' 
not specified"))
         val samplingRatio = 
parameters.get("samplingRatio").map(_.toDouble).getOrElse(1.0)
     
    -    JSONRelation(fileName, samplingRatio)(sqlContext)
    +    JSONRelation(fileName, samplingRatio, schema)(sqlContext)
       }
     }
     
    -private[sql] case class JSONRelation(fileName: String, samplingRatio: 
Double)(
    +private[sql] case class JSONRelation(
    +    fileName: String,
    +    samplingRatio: Double,
    +    _schema: Option[StructType])(
    --- End diff --
    
    instead of `_schema`, how about `userSpecifiedSchema`?


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