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

    https://github.com/apache/spark/pull/1346#discussion_r15482888
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -89,6 +90,44 @@ class SQLContext(@transient val sparkContext: 
SparkContext)
         new SchemaRDD(this, SparkLogicalPlan(ExistingRdd.fromProductRdd(rdd)))
     
       /**
    +   * :: DeveloperApi ::
    +   * Creates a [[SchemaRDD]] from an [[RDD]] containing [[Row]]s by 
applying a schema to this RDD.
    +   * It is important to make sure that the structure of every [[Row]] of 
the provided RDD matches
    +   * the provided schema. Otherwise, there will be runtime exception.
    +   *
    +   * @group userf
    +   */
    +  @DeveloperApi
    +  def applySchema(rowRDD: RDD[Row], schema: StructType): SchemaRDD = {
    +    // TODO: use MutableProjection when rowRDD is another SchemaRDD and 
the applied
    +    // schema differs from the existing schema on any field data type.
    +    val logicalPlan = SparkLogicalPlan(ExistingRdd(schema.toAttributes, 
rowRDD))
    +    new SchemaRDD(this, logicalPlan)
    +  }
    +
    +  /**
    +   * Parses the data type in our internal string representation. The data 
type string should
    +   * have the same format as the one generate by `toString` in scala.
    --- End diff --
    
    Is this only here for pyspark?  Probably should make a note of that.
    
    Nit: "generated"


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

Reply via email to