GitHub user gatorsmile opened a pull request:

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

    [SPARK-17440] [SPARK-17441] Fixed Multiple Bugs in ALTER TABLE

    ### What changes were proposed in this pull request?
    For the following `ALTER TABLE` DDL, we should issue an exception when the 
target table is a `VIEW`:
    ```SQL
     ALTER TABLE viewName SET LOCATION '/path/to/your/lovely/heart'
    
     ALTER TABLE viewName SET SERDE 'whatever'
    
     ALTER TABLE viewName SET SERDEPROPERTIES ('x' = 'y')
    
     ALTER TABLE viewName PARTITION (a=1, b=2) SET SERDEPROPERTIES ('x' = 'y')
    
     ALTER TABLE viewName ADD IF NOT EXISTS PARTITION (a='4', b='8')
    
     ALTER TABLE viewName DROP IF EXISTS PARTITION (a='2')
    
     ALTER TABLE viewName RECOVER PARTITIONS
    
     ALTER TABLE viewName PARTITION (a='1', b='q') RENAME TO PARTITION 
(a='100', b='p')
    ```
    
    In addition, `ALTER TABLE RENAME PARTITION` is unable to handle data source 
tables, just like the other `ALTER PARTITION` commands. We should issue an 
exception instead. 
    
    ### How was this patch tested?
    Added a few test cases.

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

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

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

    https://github.com/apache/spark/pull/15004.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 #15004
    
----
commit 16efafaa45e993774424f32845e7a6248f389115
Author: gatorsmile <[email protected]>
Date:   2016-09-07T22:23:53Z

    fix.

commit ea630f89ca3a3c0a3ae97bf2b9a14e4956657a9c
Author: gatorsmile <[email protected]>
Date:   2016-09-07T22:32:58Z

    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