Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1041#discussion_r13782689
--- 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 --
we gotta have a few of similar implementations already for this. I think
@yhuai was consolidating them. @yhuai can you comment on whether this would
still be necessary after your consolidation?
---
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.
---