GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/5513

    [SPARK-6911] [SQL] improve accessor for nested types

    Support access columns by index in Python: 
    ```
    >>> df[df[0] > 3].collect()
    [Row(age=5, name=u'Bob')]
    ```
    
    Access items in ArrayType or MapType
    ```
    >>> df.select(df.l.getItem(0), df.d.getItem("key")).show()
    >>> df.select(df.l[0], df.d["key"]).show()
    ```
    
    Access field in StructType
    ```
    >>> df.select(df.r.getField("b")).show()
    >>> df.select(df.r.a).show()
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark access

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/5513.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5513
    
----
commit 11f1df3470d812f867c68e68ec2094cc08577f7d
Author: Davies Liu <[email protected]>
Date:   2015-04-14T18:34:13Z

    improve accessor for nested types

----


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to