Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/1041#discussion_r13782741
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
@@ -298,19 +298,27 @@ class SQLContext(@transient val sparkContext:
SparkContext)
/**
* Peek at the first row of the RDD and infer its schema.
- * TODO: We only support primitive types, add support for nested types.
*/
private[sql] def inferSchema(rdd: RDD[Map[String, _]]): SchemaRDD = {
+ import scala.collection.JavaConversions._
+ def typeFor(obj: Any): DataType = obj match {
--- End diff --
Seems it will not be necessary once the work on the type system finishes.
In #999, those similar methods are in JsonRDD. We will move those general
purpose stuff to the type system once #999 has been checked in.
---
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.
---