GitHub user jiangxb1987 opened a pull request:

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

    [SPARK-19024][SQL] Implement new approach to write a permanent view

    ## What changes were proposed in this pull request?
    
    On CREATE/ALTER a view, it's no longer needed to generate a SQL text string 
from the LogicalPlan, instead we store the SQL query text、the output column 
names of the query plan, and current database to CatalogTable. Permanent views 
created by this approach can be resolved by current view resolution approach.
    
    The main advantage includes:
    1. If you update an underlying view, the current view also gets updated;
    2. That gives us a change to get ride of SQL generation for operators.
    
    Major changes of this PR:
    1. Generate the view-specific properties(e.g. view default database, view 
query output column names) during permanent view creation and store them as 
properties in the CatalogTable;
    2. Update the commands `CreateViewCommand` and `AlterViewAsCommand`, get 
rid of SQL generation from them.
    
    ## How was this patch tested?
    Existing tests.

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

    $ git pull https://github.com/jiangxb1987/spark view-write-path

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

    https://github.com/apache/spark/pull/16613.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 #16613
    
----
commit 917ca040002fcb57e1947b2f619ad3e2b2fd32c2
Author: jiangxingbo <jiangxb1...@gmail.com>
Date:   2017-01-17T09:41:25Z

    implement view write path for the new approach.

----


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