6
votes

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.

1
Looks like this is a known issue from back in 2009 - issues.apache.org/jira/browse/HIVE-335 Doesn't look like there is any way around itAlex Joseph

1 Answers

0
votes

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.