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

    https://github.com/apache/spark/pull/4498#discussion_r24429187
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -264,8 +262,80 @@ class SQLContext(@transient val sparkContext: 
SparkContext)
       }
     
       @DeveloperApi
    -  def applySchema(rowRDD: JavaRDD[Row], schema: StructType): DataFrame = {
    -    applySchema(rowRDD.rdd, schema);
    +  def createDataFrame(rowRDD: JavaRDD[Row], schema: StructType): DataFrame 
= {
    +    createDataFrame(rowRDD.rdd, schema)
    +  }
    +
    +  /**
    +   * Creates a [[DataFrame]] from an [[RDD]] containing [[Row]]s by 
applying
    +   * a seq of names of columns to this RDD, the data type for each column 
will
    +   * be inferred by the first row.
    +   *
    +   * @param rowRDD an RDD of Row
    +   * @param columns names for each column
    +   * @return DataFrame
    +   */
    +  def createDataFrame(rowRDD: RDD[Row], columns: Seq[String]): DataFrame = 
{
    --- End diff --
    
    Can you give some use cases for this interface? I feel if we ask users to 
create Row objects, they should know the types of fields in Rows and create the 
StructType representing the 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 [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