Hi Ankita,

We wanted to avoid user from dropping table created by another user. By
> changing the hdfs permission of the table dir, we were able to prevent the
> table from getting deleted from hdfs. But unfortunately, hive deletes the
> metadata related to the table from the mysql metastore.
>
>
The strategy that Hive currently employs for operations like this is to
first attempt update the data in the metastore db, and iff that succeeds it
then attempts to make the corresponding changes in HDFS. Eventually we hope
to build authorization facilities into the MetaStore (see
https://issues.apache.org/jira/browse/HIVE-78).


> I am wondering if any one has any pointers to this problem.
>
> It would also help if someone could point me to the hive code where it is
> doing deletion. It seems that we just have to exit if hdfs throws error and
> should not delete metadata in this case.
>

The code you're looking for is the drop_table_core() method in
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java.

Thanks.

Carl

Reply via email to