[ https://issues.apache.org/jira/browse/HIVE-26700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17631302#comment-17631302 ]
Ayush Saxena commented on HIVE-26700: ------------------------------------- try via TBLPROPERTIES setting the value of owner, this command isn't supported now > alter view set owner is throwing exception > ------------------------------------------ > > Key: HIVE-26700 > URL: https://issues.apache.org/jira/browse/HIVE-26700 > Project: Hive > Issue Type: Bug > Components: HiveServer2 > Reporter: Taraka Rama Rao Lethavadla > Priority: Major > > Tested in 3.1, we can alter the view with alter table command itself > desc formatted test_view_owner; > {noformat} > +-------------------------------+----------------------------------------------------+-----------------------+ > | col_name | data_type > | comment | > +-------------------------------+----------------------------------------------------+-----------------------+ > | # col_name | data_type > | comment | > | id | int > | | > | name | string > | | > | | NULL > | NULL | > | # Detailed Table Information | NULL > | NULL | > | Database: | default > | NULL | > | OwnerType: | USER > | NULL | > | Owner: | hive > | NULL | > | CreateTime: | Tue Oct 25 20:40:47 GMT+08:00 2022 > | NULL | > | LastAccessTime: | UNKNOWN > | NULL | > | Retention: | 0 > | NULL | > | Table Type: | VIRTUAL_VIEW > | NULL | > | Table Parameters: | NULL > | NULL | > | | bucketing_version > | 2 | > | | transient_lastDdlTime > | 1666701647 | > | | NULL > | NULL | > | # Storage Information | NULL > | NULL | > | SerDe Library: | null > | NULL | > | InputFormat: | > org.apache.hadoop.hive.ql.io.orc.OrcInputFormat | NULL | > | OutputFormat: | > org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat | NULL | > | Compressed: | No > | NULL | > | Num Buckets: | -1 > | NULL | > | Bucket Columns: | [] > | NULL | > | Sort Columns: | [] > | NULL | > | | NULL > | NULL | > | # View Information | NULL > | NULL | > | Original Query: | select * from test_owner_hive > | NULL | > | Expanded Query: | select `test_owner_hive`.`id`, > `test_owner_hive`.`name` from `default`.`test_owner_hive` | NULL > | > +-------------------------------+----------------------------------------------------+-----------------------+{noformat} > alter table test_view_owner set owner user tarak; > desc formatted test_view_owner; > {noformat} > +-------------------------------+----------------------------------------------------+-----------------------+ > | col_name | data_type > | comment | > +-------------------------------+----------------------------------------------------+-----------------------+ > | # col_name | data_type > | comment | > | id | int > | | > | name | string > | | > | | NULL > | NULL | > | # Detailed Table Information | NULL > | NULL | > | Database: | default > | NULL | > | OwnerType: | USER > | NULL | > | Owner: | tarak > | NULL | > | CreateTime: | Tue Oct 25 20:40:47 GMT+08:00 2022 > | NULL | > | LastAccessTime: | UNKNOWN > | NULL | > | Retention: | 0 > | NULL | > | Table Type: | VIRTUAL_VIEW > | NULL | > | Table Parameters: | NULL > | NULL | > | | bucketing_version > | 2 | > | | last_modified_by > | hive | > | | last_modified_time > | 1666701765 | > | | transient_lastDdlTime > | 1666701765 | > | | NULL > | NULL | > | # Storage Information | NULL > | NULL | > | SerDe Library: | null > | NULL | > | InputFormat: | > org.apache.hadoop.hive.ql.io.orc.OrcInputFormat | NULL | > | OutputFormat: | > org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat | NULL | > | Compressed: | No > | NULL | > | Num Buckets: | -1 > | NULL | > | Bucket Columns: | [] > | NULL | > | Sort Columns: | [] > | NULL | > | | NULL > | NULL | > | # View Information | NULL > | NULL | > | Original Query: | select * from test_owner_hive > | NULL | > | Expanded Query: | select `test_owner_hive`.`id`, > `test_owner_hive`.`name` from `default`.`test_owner_hive` | NULL > | > +-------------------------------+----------------------------------------------------+-----------------------+ > 30 rows selected (0.093 seconds){noformat} > But the same is not working in newer version > {noformat} > alter table test_view_owner set owner user tarak;{noformat} > {noformat} > Error: Error while compiling statement: FAILED: SemanticException [Error > 10131]: To alter a view you need to use the ALTER VIEW command. > (state=42000,code=10131){noformat} > {noformat} > alter view test_view_owner set owner user tarak;{noformat} > {noformat} > Error: Error while compiling statement: FAILED: ParseException line 1:31 > mismatched input 'owner' expecting TBLPROPERTIES near 'set' in alter view > properties statement (state=42000,code=40000){noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)