[
https://issues.apache.org/jira/browse/HIVE-24920?focusedWorklogId=600453&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-600453
]
ASF GitHub Bot logged work on HIVE-24920:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 21/May/21 15:51
Start Date: 21/May/21 15:51
Worklog Time Spent: 10m
Work Description: kgyrtkirk commented on a change in pull request #2191:
URL: https://github.com/apache/hive/pull/2191#discussion_r637024947
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java
##########
@@ -822,7 +934,7 @@ private Table validateTablePaths(Table table) throws
MetaException {
+ table.getTableName() + ",location:" + tablePath +
",Database's managed warehouse:" + dbLocation);
}
} else {
- if (FileUtils.isSubdirectory(whRootPath.toString(),
tablePath.toString())) {
+ if (isExternalWarehouseSet() &&
FileUtils.isSubdirectory(whRootPath.toString(), tablePath.toString())) {
Review comment:
I just bumped into this while fixing this issue - in case the
`externalWarehouse` is not set both external and managed tables are placed at
the same location with the default configs:
```
create external table te (a integer); // file:/data/hive/warehouse/t
desc formatted te;
[...]
| Location: | file:/data/hive/warehouse/te
| NULL |
| Table Parameters: | NULL
| NULL |
| | EXTERNAL
| TRUE |
[...]
create table tm (a integer);
desc formatted tm;
[...]
| Location: | file:/data/hive/warehouse/tm
| NULL |
| Table Type: | EXTERNAL_TABLE
| NULL |
| | EXTERNAL
| TRUE |
| | TRANSLATED_TO_EXTERNAL
| TRUE |
[...]
```
the root cause of this is that
* in case the ext wh is not set - it will be the default whroot:
https://github.com/apache/hive/blob/bf608ceadaf571440b0ead079adab674400fc956/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java#L209
* managed location for both default and non-default dbs are under wh by
default
since the managed location is the same I don't think checking that would
make sense...
don't you think that the current change aligns with the existing
decisions/behaiour/etc in the above case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 600453)
Time Spent: 1h (was: 50m)
> TRANSLATED_TO_EXTERNAL tables may write to the same location
> ------------------------------------------------------------
>
> Key: HIVE-24920
> URL: https://issues.apache.org/jira/browse/HIVE-24920
> Project: Hive
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> {code}
> create table t (a integer);
> insert into t values(1);
> alter table t rename to t2;
> create table t (a integer); -- I expected an exception from this command
> (location already exists) but because its an external table no exception
> insert into t values(2);
> select * from t; -- shows 1 and 2
> drop table t2; -- wipes out data location
> select * from t; -- empty resultset
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)