Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4498#discussion_r24396268
--- 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 --
we might want to use the same logic defined in jsonrdd?
---
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]