MAPREDUCE服务 MRS-ALTER VIEW:示例

时间:2024-07-02 16:39:31

示例

CREATE OR REPLACE VIEW tv_view as SELECT id,name from (values (1, 'HetuEngine')) as x(id,name);
 
SELECT * FROM tv_view;
 id | name 
----|------
  1 | HetuEngine   
(1 row)
 
ALTER VIEW tv_view as SELECT id, brand FROM (VALUES (1, 'brand_1', 100), (2, 'brand_2', 300) ) AS x (id, brand, price);
 
SELECT * FROM tv_view;
 id |  brand  
----|---------
  1 | brand_1 
  2 | brand_2 
(2 rows)
 
ALTER VIEW tv_view SET TBLPROPERTIES ('comment' = 'This is a new comment');
 
show tblproperties tv_view;
                           SHOW TBLPROPERTIES                         
--------------------------------------------------------------------
        comment                 'This is a new comment'                          
        presto_query_id         '20210325_034712_00040_f63xj@default@HetuEngine' 
        presto_version                                                         
        presto_view             'true'                                           
        transient_lastDdlTime   '1616644032'                                                                                                     
(1 row)
support.huaweicloud.com/cmpntguide-lts-mrs/mrs_01_300139.html