GitHub user dongjoon-hyun opened a pull request:

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

    [SPARK-19012][SQL] Fix `createTempViewCommand` to throw AnalysisException 
instead of ParseException

    ## What changes were proposed in this pull request?
    
    Currently, `createTempView`, `createOrReplaceTempView`, and 
`createGlobalTempView` show `ParseExceptions` on invalid table names. We had 
better show better error message. Also, this PR also adds and updates the 
missing description on the API docs correctly.
    
    **BEFORE**
    ```
    scala> spark.range(10).createOrReplaceTempView("11111")
    org.apache.spark.sql.catalyst.parser.ParseException:
    mismatched input '11111' expecting {'SELECT', 'FROM', 'ADD', ...}(line 1, 
pos 0)
    
    == SQL ==
    11111
    ...
    ```
    
    **AFTER**
    ```
    scala> spark.range(10).createOrReplaceTempView("11111")
    org.apache.spark.sql.AnalysisException: Invalid view name: 11111;
    ...
    ```
    
    ## How was this patch tested?
    
    Pass the Jenkins with updated a test case.

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

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-19012

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

    https://github.com/apache/spark/pull/16427.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 #16427
    
----
commit 995f3b95b99e9ec03cd377731963b76b4a8cf2ef
Author: Dongjoon Hyun <[email protected]>
Date:   2016-12-29T00:29:38Z

    [SPARK-19012][SQL] Fix CreateOrReplaceTempView to throw AnalysisException 
instead of ParseException

----


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