Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/1598#discussion_r15714150
--- Diff: python/pyspark/sql.py ---
@@ -522,71 +866,112 @@ def _ssql_ctx(self):
return self._scala_SQLContext
def inferSchema(self, rdd):
- """Infer and apply a schema to an RDD of L{dict}s.
+ """Infer and apply a schema to an RDD of L{Row}s.
+
+ We peek at the first row of the RDD to determine the fields' names
+ and types. Nested collections are supported, which include array,
+ dict, list, Row, tuple, namedtuple, or object.
--- End diff --
Can we add a note about the complications with us only looking at the first
row. In particular, the type can't change in future rows and this breaks if
there are `None` in the first row. Also do we throw an exceptions for `None`s?
---
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.
---