You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/04/25 16:00:47 UTC

[GitHub] [hive] adrian-wang opened a new pull request, #3240: HIVE-26174 disable rename table across dbs when on different filesystem

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 (...);
   -- write some data to db1.table1
   ALTER TABLE db1.table1 RENAME TO db2.table2;
   ```
   The `ALTER TABLE RENAME TO` command will success and, table location is under `/s3warehouse/db2.db/table2`(s3), which is like undefined behavior of the language manual.
   
   After this fix, the `ALTER TABLE RENAME TO` command will fail with message telling user that Hive cannot rename tables because they are on different filesystem.
   
   ### How was this patch tested?
   
   Manually tested.
   


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] adrian-wang commented on pull request #3240: HIVE-26174 disable rename table across dbs when on different filesystem

Posted by GitBox <gi...@apache.org>.
adrian-wang commented on PR #3240:
URL: https://github.com/apache/hive/pull/3240#issuecomment-1121829345

   Hi @ayushtkn , In our customers' scenario, they want to put table data in HDFS, while some stale tables will be archived to cloud store. They were using this command and thought that data should be placed in cloud store, but after a while they found it is still in HDFS. Besides, currently if we have two dbs located on two different HDFS services, the command would fail, Hence I think we should not allow rename when two dbs are on different storages.


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #3240: HIVE-26174 disable rename table across dbs when on different filesystem

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #3240:
URL: https://github.com/apache/hive/pull/3240#issuecomment-1179627322

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #3240: HIVE-26174 disable rename table across dbs when on different filesystem

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #3240: HIVE-26174 disable rename table across dbs when on different filesystem
URL: https://github.com/apache/hive/pull/3240


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org