GitHub user zjffdu reopened a pull request:

    https://github.com/apache/zeppelin/pull/1404

    ZEPPELIN-1411. UDF with pyspark not working - object has no attribute 
'parseDataType'

    ### What is this PR for?
    The root cause is that SQLContext's signature changes in spark 2.0. 
    Spark 1.6
    ```
    def __init__(self, sparkContext, sqlContext=None):
    ```
    Spark 2.0
    ```
    def __init__(self, sparkContext, sparkSession=None, jsqlContext=None):
    ```
    So we need to create SQLContext using named parameters, otherwise it would 
take intp.getSQLContext() as sparkSession which cause the issue.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-1411
    
    ### How should this be tested?
    Tested using the example code in ZEPPELIN-1411. 
    
    ### Screenshots (if appropriate)
    
![image](https://cloud.githubusercontent.com/assets/164491/18260139/9bd702c0-741d-11e6-8b23-946c38a794c3.png)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No


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

    $ git pull https://github.com/zjffdu/zeppelin ZEPPELIN-1411

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

    https://github.com/apache/zeppelin/pull/1404.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 #1404
    
----
commit 296c63fdf44edda96cbe12928213d8a39eabd33c
Author: Jeff Zhang <zjf...@apache.org>
Date:   2016-09-06T02:26:05Z

    ZEPPELIN-1411. UDF with pyspark not working - object has no attribute 
'parseDataType'

commit 4fe033d3e700ff9571da78761f21c6e88689ae55
Author: Jeff Zhang <zjf...@apache.org>
Date:   2016-09-09T06:21:37Z

    add unit test

commit 4922de1d46f625cbec97a4529ac2c6ca78c75d07
Author: Jeff Zhang <zjf...@apache.org>
Date:   2016-09-14T06:24:36Z

    log more logging for travis CI diangnose

commit a4fda473b5fe4acf799187dc3eb67c0f94d3ea1d
Author: Jeff Zhang <zjf...@apache.org>
Date:   2016-09-14T07:42:39Z

    retry

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to