File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
sql/core/src/main/scala/org/apache/spark/sql/api/r Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ private[r] object SQLUtils {
66
66
StructField (name, dtObj, nullable)
67
67
}
68
68
69
+ // cfreeman: I don't think we need this anymore since we can pass structType from R
70
+ // def createDF(rdd: RDD[Array[Byte]], schemaString: String, sqlContext: SQLContext): DataFrame = {
71
+ // val schema = DataType.fromJson(schemaString).asInstanceOf[StructType]
72
+ // val num = schema.fields.size
73
+ // val rowRDD = rdd.map(bytesToRow)
74
+ // sqlContext.createDataFrame(rowRDD, schema)
75
+ // }
76
+
77
+ def createDF (rdd : RDD [Array [Byte ]], schema : StructType , sqlContext : SQLContext ): DataFrame = {
69
78
val num = schema.fields.size
70
79
val rowRDD = rdd.map(bytesToRow)
71
80
sqlContext.createDataFrame(rowRDD, schema)
You can’t perform that action at this time.
0 commit comments