GitHub user gatorsmile opened a pull request:

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

    [SPARK-18430] [SQL] Fixed Exception Messages when Hitting an Invocation 
Exception of Function Lookup

    ### What changes were proposed in this pull request?
    When the exception is an invocation exception during function lookup, we 
return a useless/confusing error message:
    
    For example, 
    ```Scala
    df.selectExpr("concat_ws()")
    ```
    Below is the error message we got:
    ```
    null; line 1 pos 0
    org.apache.spark.sql.AnalysisException: null; line 1 pos 0
    ```
    
    To get the meaningful error message, we need to get the cause. The fix is 
exactly the same as what we did in https://github.com/apache/spark/pull/12136. 
After the fix, the message we got is the exception issued in the constuctor of 
function implementation:
    ```
    requirement failed: concat_ws requires at least one argument.; line 1 pos 0
    org.apache.spark.sql.AnalysisException: requirement failed: concat_ws 
requires at least one argument.; line 1 pos 0
    ```
    
    ### How was this patch tested?
    Added test cases.

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

    $ git pull https://github.com/gatorsmile/spark functionNotFound

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

    https://github.com/apache/spark/pull/15878.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 #15878
    
----
commit a43acced66fa15228b6c32176bb9f28dacb6f024
Author: gatorsmile <[email protected]>
Date:   2016-11-14T06:28:11Z

    fix.

----


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