Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/14874
  
    This is another bug in the existing `ALTER VIEW`. Let me show what I got in 
Hive:
    
    ```SQL
    hive> create view t1_view comment 'test_comment' TBLPROPERTIES ('p1'='v1') 
as select * from t1;
    ```
    ```
    hive> describe formatted t1_view;
    OK
    # col_name                  data_type               comment             
                 
    col                         int                                         
                 
    # Detailed Table Information                 
    Database:                   default                  
    Owner:                      root                     
    CreateTime:                 Tue Aug 30 13:32:41 EDT 2016     
    LastAccessTime:             UNKNOWN                  
    Protect Mode:               None                     
    Retention:                  0                        
    Table Type:                 VIRTUAL_VIEW             
    Table Parameters:            
        comment                 test_comment        
        p1                      v1                  
        transient_lastDdlTime   1472578361          
                 
    # Storage Information                
    SerDe Library:              null                     
    InputFormat:                
org.apache.hadoop.mapred.SequenceFileInputFormat         
    OutputFormat:               
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat        
    Compressed:                 No                       
    Num Buckets:                -1                       
    Bucket Columns:             []                       
    Sort Columns:               []                       
                 
    # View Information           
    View Original Text:         select * from t1         
    View Expanded Text:         select `t1`.`col` from `default`.`t1`    
    Time taken: 0.074 seconds, Fetched: 29 row(s)
    ```
    
    ```SQL
    hive> alter view t1_view as select col from t1;
    ```
    
    ```
    hive> describe formatted t1_view;
    OK
    # col_name                  data_type               comment             
                 
    col                         int                                         
                 
    # Detailed Table Information                 
    Database:                   default                  
    Owner:                      root                     
    CreateTime:                 Tue Aug 30 13:32:41 EDT 2016     
    LastAccessTime:             UNKNOWN                  
    Protect Mode:               None                     
    Retention:                  0                        
    Table Type:                 VIRTUAL_VIEW             
    Table Parameters:            
        comment                 test_comment        
        p1                      v1                  
        transient_lastDdlTime   1472578421          
                 
    # Storage Information                
    SerDe Library:              null                     
    InputFormat:                
org.apache.hadoop.mapred.SequenceFileInputFormat         
    OutputFormat:               
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat        
    Compressed:                 No                       
    Num Buckets:                -1                       
    Bucket Columns:             []                       
    Sort Columns:               []                       
                 
    # View Information           
    View Original Text:         select col from t1       
    View Expanded Text:         select `t1`.`col` from `default`.`t1`    
    Time taken: 0.065 seconds, Fetched: 29 row(s)
    ```
    
    After `ALTER VIEW`, we need to keep the existing table properties and 
comment.



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