GitHub user gatorsmile opened a pull request:

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

    [SPARK-17660] [SQL] DESC FORMATTED for VIEW Lacks View Definition

    ### What changes were proposed in this pull request?
    Before this PR, DESC FORMATTED does not have a section for the view 
definition. We should add it for permanent views, like what Hive does.
    
    ```
    
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------+
    |col_name                    |data_type                                     
                                                                                
       |comment|
    
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------+
    |a                           |int                                           
                                                                                
       |null   |
    |                            |                                              
                                                                                
       |       |
    |# Detailed Table Information|                                              
                                                                                
       |       |
    |Database:                   |default                                       
                                                                                
       |       |
    |Owner:                      |xiaoli                                        
                                                                                
       |       |
    |Create Time:                |Sat Sep 24 21:46:19 PDT 2016                  
                                                                                
       |       |
    |Last Access Time:           |Wed Dec 31 16:00:00 PST 1969                  
                                                                                
       |       |
    |Location:                   |                                              
                                                                                
       |       |
    |Table Type:                 |VIEW                                          
                                                                                
       |       |
    |Table Parameters:           |                                              
                                                                                
       |       |
    |  transient_lastDdlTime     |1474778779                                    
                                                                                
       |       |
    |                            |                                              
                                                                                
       |       |
    |# Storage Information       |                                              
                                                                                
       |       |
    |SerDe Library:              
|org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe                             
                                                      |       |
    |InputFormat:                
|org.apache.hadoop.mapred.SequenceFileInputFormat                               
                                                      |       |
    |OutputFormat:               
|org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat                      
                                                      |       |
    |Compressed:                 |No                                            
                                                                                
       |       |
    |Storage Desc Parameters:    |                                              
                                                                                
       |       |
    |  serialization.format      |1                                             
                                                                                
       |       |
    |                            |                                              
                                                                                
       |       |
    |# View Information          |                                              
                                                                                
       |       |
    |View Original Text:         |SELECT * FROM tbl                             
                                                                                
       |       |
    |View Expanded Text:         |SELECT `gen_attr_0` AS `a` FROM (SELECT 
`gen_attr_0` FROM (SELECT `a` AS `gen_attr_0` FROM `default`.`tbl`) AS 
gen_subquery_0) AS tbl|       |
    
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------+-------+
    ```
    
    ### How was this patch tested?
    Added a test case

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

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

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

    https://github.com/apache/spark/pull/15234.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 #15234
    
----
commit 4d6d0979025d0d0dfcde0b8db4209438685ca5c3
Author: gatorsmile <gatorsm...@gmail.com>
Date:   2016-09-25T04:42:02Z

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