为什么用户需要在外部配置单元表的位置上写入权限? [英] Why does the user need write permission on the location of external hive table?

查看:92
本文介绍了为什么用户需要在外部配置单元表的位置上写入权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Hive中,您可以创建两种表:托管表和外部表

对于托管表,您拥有数据,因此,当您删除表时,数据被删除。



在外部表格的情况下,您没有数据的所有权,因此当您删除这样的表格时,基础数据不会被删除。只有元数据被删除。



现在,最近我观察到,您无法在您没有写入(修改)权限的位置创建外部表HDFS。我完全无法理解这一点。

用例:您正在搅动的数据非常普遍,而且是只读的。因此,要通过Hive来转移此类数据,您是否必须将这些庞大的数据复制到您拥有写入权限的位置?

请帮助。

解决方案

尽管丢弃外部数据确实不会导致数据丢失,但这并不意味着外部表仅用于读取数据。例如,您应该可以在外部表上执行 INSERT OVERWRITE



就是说,它当你只有读访问权时,肯定可以使用(内部)表,所以我怀疑外部表也是如此。尝试使用具有写入权限的帐户创建表格,然后将其与常规帐户一起使用。


In Hive, you can create two kinds of tables: Managed and External

In case of managed table, you own the data and hence when you drop the table the data is deleted.

In case of external table, you don't have ownership of the data and hence when you delete such a table, the underlying data is not deleted. Only metadata is deleted.

Now, recently i have observed that you can not create an external table over a location on which you don't have write (modification) permissions in HDFS. I completely fail to understand this.

Use case: It is quite common that the data you are churning is huge and read-only. So, to churn such data via Hive, will you have to copy this huge data to a location on which you have write permissions?

Please help.

解决方案

Though it is true that dropping an external data does not result in dropping the data, this does not mean that external tables are for reading only. For instance, you should be able to do an INSERT OVERWRITE on an external table.

That being said, it is definitely possible to use (internal) tables when you only have read access, so I suspect this is the case for external tables as well. Try creating the table with an account that has write acces, and then using it with your regular account.

这篇关于为什么用户需要在外部配置单元表的位置上写入权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆