Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1598#discussion_r15616211
  
    --- Diff: python/pyspark/sql.py ---
    @@ -634,20 +645,18 @@ def jsonFile(self, path, schema=None):
             >>> sqlCtx.registerRDDAsTable(srdd1, "table1")
             >>> srdd2 = sqlCtx.sql(
             ...   "SELECT field1 AS f1, field2 as f2, field3 as f3, field6 as 
f4 from table1")
    -        >>> srdd2.collect() == [
    -        ... {"f1":1, "f2":"row1", "f3":{"field4":11, "field5": None}, 
"f4":None},
    -        ... {"f1":2, "f2":None, "f3":{"field4":22,  "field5": [10, 11]}, 
"f4":[{"field7": "row2"}]},
    -        ... {"f1":None, "f2":"row3", "f3":{"field4":33, "field5": []}, 
"f4":None}]
    -        True
    +        >>> srdd2.collect()
    +        [Row(f1=1, f2=u'row1', f3=Row(field4=11, field5=None), f4=None), \
    +Row(f1=2, f2=None, f3=Row(field4=22, field5=[10, 11]), 
f4=[Row(field7=u'row2')]), \
    +Row(f1=None, f2=u'row3', f3=Row(field4=33, field5=[]), f4=None)]
    --- End diff --
    
    Breaking the doc comment like this is kind of weird; could you instead do a 
`for r in srdd2.collect(): print r` and get one per line?


---
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.
---

Reply via email to