GitHub user cloud-fan opened a pull request:

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

    [SPARK-17361][SQL] createExternalTable should fail if path is not given for 
file-based data source

    ## What changes were proposed in this pull request?
    
    Using the public `Catalog` API, users can create a file-based data source 
table, without giving the path options. For this case, currently we can create 
the table successfully, but fail when we read it.
    
    This is because when we create data source table, we resolve the data 
source relation without validating path: `resolveRelation(checkPathExist = 
false)`.
    
    `resolveRelation` is used to validate some arguments and infer schema and 
partitions, which is useless to managed table. So in this PR, we only resolve 
data source relation for external table, then we can remove the 
`checkPathExist` parameter in `DataSource.resolveRelation` and do some related 
cleanups.
    
    ## How was this patch tested?
    
    existing tests and new test in `CatalogSuite`

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

    $ git pull https://github.com/cloud-fan/spark check-path

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

    https://github.com/apache/spark/pull/14921.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 #14921
    
----
commit d53bf61ced6aa339c3e370dd2a320863ae6434c1
Author: Wenchen Fan <wenc...@databricks.com>
Date:   2016-09-01T14:36:33Z

    createExternalTable should fail if path is not given for file-based data 
source

----


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to