Re: Review Request 53110: HIVE-14909: Preserve the "parent location" of the table when an "alter table rename to " is submitted (the case when the db location is not specified and the Hive defult db is outside the same encrypted zone)

Wed, 26 Oct 2016 16:34:50 -0700


> On Oct. 26, 2016, 7:04 p.m., Aihua Xu wrote:
> > metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java, 
> > line 166
> > <https://reviews.apache.org/r/53110/diff/3/?file=1545378#file1545378line166>
> >
> >     Can we implement the logic like: if a location is not specified, then a 
> > default location will be given. When we rename the table, we will preserve 
> > the location even if it's a default location, but just changing the table 
> > name to the new one?
> >     
> >     Seems that's more natural, but I guess we have a reason for that? Any 
> > problems with that?
> 
> Chaoyu Tang wrote:
>     If a location is not provided in the newTable in alter table, the default 
> location will be given and it will be the path like 
> database_location/newtable_name, it is the present behaviour. I do not know 
> why the old code works in this way, and I think it reasonable so did not 
> change that.

Yeah. That's true. That would be a significant behaivor change. Maybe we can 
investigate in the followup jira.


- Aihua


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53110/#review153924
-----------------------------------------------------------


On Oct. 26, 2016, 1:20 a.m., Chaoyu Tang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53110/
> -----------------------------------------------------------
> 
> (Updated Oct. 26, 2016, 1:20 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Bugs: HIVE-14909
>     https://issues.apache.org/jira/browse/HIVE-14909
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Since Hive supports the DDL like:
> create table foo (key int) location 'path_to_location'
> to create a managed table by specifying its location rather than that under 
> its database. So table rename should respect this specified location, and not 
> change its location or move its data. Its location should be change using a 
> different command 'alter table .. set location ...' instead.
> 
> 
> Diffs
> -----
> 
>   
> hcatalog/core/src/test/java/org/apache/hive/hcatalog/cli/TestSemanticAnalysis.java
>  ce4ef75 
>   metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java 
> 7b84595 
>   ql/src/test/queries/clientpositive/encryption_move_tbl.q a25d955 
>   ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out 
> 910ce25 
> 
> Diff: https://reviews.apache.org/r/53110/diff/
> 
> 
> Testing
> -------
> 
> Unit tests
> Manaual tests
> 
> 
> Thanks,
> 
> Chaoyu Tang
> 
>

Reply via email to