Insert Overwrite: Cannot move … to the trash, as it contains the trash

↘锁芯ラ 提交于 2019-12-11 20:35:51

问题


I am attempting to insert into a table by selecting from another:

INSERT OVERWRITE TABLE testtable1 select * from testtable0

The error:

Moving data to: wasb://{container}@{storage}.blob.core.windows.net/hive/scratch/hive_2015-06-01_15-05-14_062_6478651325775395196-1/-ext-10000
Loading data to table default.testtable1
rmr: DEPRECATED: Please use 'rm -r' instead.
rmr: Cannot move "wasb://{container}@{storage}.blob.core.windows.net/" to the trash, as it contains the trash. Consider using -skipTrash option
Failed with exception null

Is the -r suggestion and the -skipTrash option to be added to the hive query? What should the syntax be, or is there a better way to do this query?


回答1:


Can you share the location you are pointing to when you create testtable1?

It seems like your testtable is pointing to the root container in your WASB storage account. Hive works on a folder level and not a file level. Since you do not provide a sub-directory for the table data to be stored in, it tries to delete the entire data in your container which contains the trash folder.

Simply add a sub-folder when you are creating your testtable and that should fix the problem.



来源:https://stackoverflow.com/questions/30577083/insert-overwrite-cannot-move-to-the-trash-as-it-contains-the-trash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!