[
https://issues.apache.org/jira/browse/HIVE-26174?focusedWorklogId=761868&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761868
]
ASF GitHub Bot logged work on HIVE-26174:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Apr/22 16:00
Start Date: 25/Apr/22 16:00
Worklog Time Spent: 10m
Work Description: adrian-wang opened a new pull request, #3240:
URL: https://github.com/apache/hive/pull/3240
### What changes were proposed in this pull request?
1. Disable rename table across dbs when dbs on different filesystem.
2. Adjust the place of comment so it matches code better.
### Why are the changes needed?
Currently, if we run `ALTER TABLE db1.table1 RENAME TO db2.table2;` with
`db1` and `db2` on different filesystem, for example `db1` as
`"hdfs:/user/hive/warehouse/db1.db"`, and `db2` as
`"s3://bucket/s3warehouse/db2.db"`, the new `db2.table2` will be under location
`hdfs:/s3warehouse/db2.db/table2`, which looks quite strange.
### Does this PR introduce _any_ user-facing change?
Yes.
Before this patch, if we run
```
CREATE DATABASE db1 LOCATION '/user/hive/warehouse/db1.db';
CREATE DATABASE db2 LOCATION 's3://bucket/s3warehouse/db2.db';
CREATE TABLE db1.table1 (...);
Issue Time Tracking
-------------------
Worklog Id: (was: 761868)
Remaining Estimate: 0h
Time Spent: 10m
> ALTER TABLE RENAME TO should check new db location
> --------------------------------------------------
>
> Key: HIVE-26174
> URL: https://issues.apache.org/jira/browse/HIVE-26174
> Project: Hive
> Issue Type: Improvement
> Reporter: Adrian Wang
> Assignee: Adrian Wang
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently, if we runĀ
> ALTER TABLE db1.table1 RENAME TO db2.table2;
> and with `db1` and `db2` on different filesystem, for example `db1` as
> `"hdfs:/user/hive/warehouse/db1.db"`, and `db2` as
> `"s3://bucket/s3warehouse/db2.db"`, the new `db2.table2` will be under
> location `hdfs:/s3warehouse/db2.db/table2`, which looks quite strange.
> The idea is to ban this kind of operation, as we seem to intend to ban that,
> but the check was done after we changed file system scheme so it was always
> true.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)