[
https://issues.apache.org/jira/browse/HIVE-26911?focusedWorklogId=837923&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-837923
]
ASF GitHub Bot logged work on HIVE-26911:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Jan/23 12:41
Start Date: 09/Jan/23 12:41
Worklog Time Spent: 10m
Work Description: dengzhhu653 commented on code in PR #3920:
URL: https://github.com/apache/hive/pull/3920#discussion_r1064598255
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java:
##########
@@ -270,8 +270,12 @@ public void alterTable(RawStore msdb, Warehouse wh, String
catName, String dbnam
// get new location
assert(isReplicated == HMSHandler.isDbReplicationTarget(db));
- if (renamedTranslatedToExternalTable) {
+ if (renamedTranslatedToExternalTable && !tableInSpecifiedLoc) {
destPath = new Path(newt.getSd().getLocation());
Review Comment:
What happen if the path for the old table `b` is
`file:${system:test.tmp.dir}/tmp.db/b`? Does it throw the same exception?
Issue Time Tracking
-------------------
Worklog Id: (was: 837923)
Time Spent: 0.5h (was: 20m)
> Renaming a translated external table with a specified location fails with
> 'location already exists' exception
> -------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-26911
> URL: https://issues.apache.org/jira/browse/HIVE-26911
> Project: Hive
> Issue Type: Bug
> Components: Standalone Metastore
> Affects Versions: 4.0.0
> Reporter: Sai Hemanth Gantasala
> Assignee: Sai Hemanth Gantasala
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Renaming a translated external table with a specified location fails with
> 'location already exists' exception.
> Below are steps for repro
> {code:java}
> create database tmp;
> use tmp;
> create table b(s string) stored as parquet location
> 'hdfs://localhost:20500/test-warehouse/tmp.db/some_location';
> alter table b rename to bb;
> ERROR: InvalidOperationException: New location for this table hive.tmp.bb
> already exists : hdfs://localhost:20500/test-warehouse/tmp.db/some_location
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)