Return-Path: Delivered-To: apmail-hadoop-hive-user-archive@minotaur.apache.org Received: (qmail 17018 invoked from network); 4 Aug 2010 17:27:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Aug 2010 17:27:10 -0000 Received: (qmail 50726 invoked by uid 500); 4 Aug 2010 17:27:09 -0000 Delivered-To: apmail-hadoop-hive-user-archive@hadoop.apache.org Received: (qmail 50338 invoked by uid 500); 4 Aug 2010 17:27:09 -0000 Mailing-List: contact hive-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-user@hadoop.apache.org Delivered-To: mailing list hive-user@hadoop.apache.org Received: (qmail 50278 invoked by uid 99); 4 Aug 2010 17:27:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Aug 2010 17:27:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.66.139.15] (HELO tems6a.ironmountain.com) (208.66.139.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Aug 2010 17:27:00 +0000 Received: from kcsmtp01.ironmountain.com (kcsmtp01.ironmountain.com [216.229.158.20]) (Using TLS) by tems6a.ironmountain.com; Wed, 04 Aug 2010 13:25:51 -0400 Received: from ([10.130.80.70]) by kcsmtp01.ironmountain.com with ESMTP with TLS id 6GMF5H1.124253539; Wed, 04 Aug 2010 12:25:43 -0500 Received: from MVMEXP01.tpt.imtn.com (10.146.10.23) by NUMEHTP03.na.imtn.com (10.130.80.70) with Microsoft SMTP Server (TLS) id 8.2.254.0; Wed, 4 Aug 2010 13:25:43 -0400 Received: from MVMEXP01.tpt.imtn.com ([::1]) by mvmexp01.tpt.imtn.com ([::1]) with mapi; Wed, 4 Aug 2010 10:25:42 -0700 From: "Bakshi, Ankita" To: "'hive-user@hadoop.apache.org'" Date: Wed, 4 Aug 2010 10:25:42 -0700 Subject: RE: how to prevent user from dropping table created by another user Thread-Topic: how to prevent user from dropping table created by another user Thread-Index: AcszZeDkxdkuFDpaSV2cF/SPhikfdwAk80JA Message-ID: <9B71D1415ABDF042ADF9FF4DCF793AA6579E74B4@mvmexp01.tpt.imtn.com> References: <9B71D1415ABDF042ADF9FF4DCF793AA6579E74B2@mvmexp01.tpt.imtn.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-MC-Unique: 110080413255101201 Content-Type: multipart/alternative; boundary="_000_9B71D1415ABDF042ADF9FF4DCF793AA6579E74B4mvmexp01tptimtn_" --_000_9B71D1415ABDF042ADF9FF4DCF793AA6579E74B4mvmexp01tptimtn_ Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Thanks Carl for the pointers. Good news is - user can recover from the failure by doing following steps: 1. For tables without partition, it is as simple as creating table definiti= on again. 2. For tables with partition, it will involve creating table definition fol= lowed by creating partitions. Thanks, Ankita ________________________________ From: Carl Steinbach [mailto:carl@cloudera.com] Sent: Tuesday, August 03, 2010 4:17 PM To: hive-user@hadoop.apache.org Subject: Re: how to prevent user from dropping table created by another use= r Hi Ankita, We wanted to avoid user from dropping table created by another user. By cha= nging the hdfs permission of the table dir, we were able to prevent the tab= le from getting deleted from hdfs. But unfortunately, hive deletes the meta= data related to the table from the mysql metastore. The strategy that Hive currently employs for operations like this is to fir= st attempt update the data in the metastore db, and iff that succeeds it th= en attempts to make the corresponding changes in HDFS. Eventually we hope t= o build authorization facilities into the MetaStore (see https://issues.apa= che.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 d= oing 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/sr= c/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java. Thanks. Carl The information contained in this email message and its attachments is inte= nded only for the private and confidential use of the recipient(s) named ab= ove, unless the sender expressly agrees otherwise. Transmission of email ov= er the Internet is not a secure communications medium. If you are requestin= g or have requested the transmittal of personal data, as defined in applica= ble privacy laws by means of email or in an attachment to email, you must s= elect a more secure alternate means of transmittal that supports your oblig= ations to protect such personal data. If the reader of this message is not = the intended recipient and/or you have received this email in error, you mu= st take no action based on the information in this email and you are hereby= notified that any dissemination, misuse or copying or disclosure of this c= ommunication is strictly prohibited. If you have received this communicatio= n in error, please notify us immediately by email and delete the original m= essage.=20 --_000_9B71D1415ABDF042ADF9FF4DCF793AA6579E74B4mvmexp01tptimtn_ Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable

=20

Thanks Carl for the pointers.
Good news is - user can recover from the failure by doing following steps:<= o:p>

1. For tables without partition, it is= as simple as creating table definition again.
2. For tables with partition, it will involve creating table definition followed by creating partitions.

 

Thanks,

Ankita

 


From: Carl Ste= inbach [mailto:carl@cloudera.com]
Sent: Tuesday, August 03, 20= 10 4:17 PM
To: hive-user@hadoop.apache.org
Subject: Re: how to prevent = user from dropping table created by another user

 

Hi Ankita,

We= wanted to avoid user from dropping table created by another user. By changing the hdf= s 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 i= s 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.apach= e.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 shoul= d 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



The information contained in this email message and its attachments is inte= nded only for the private and confidential use of the recipient(s) named ab= ove, unless the sender expressly agrees otherwise. Transmission of email ov= er the Internet is not a secure communications medium. If you are requestin= g or have requested the transmittal of personal data, as defined in applica= ble privacy laws by means of email or in an attachment to email, you must s= elect a more secure alternate means of transmittal that supports your oblig= ations to protect such personal data. If the reader of this message is not = the intended recipient and/or you have received this email in error, you mu= st take no action based on the information in this email and you are hereby= notified that any dissemination, misuse or copying or disclosure of this c= ommunication is strictly prohibited. If you have received this communicatio= n in error, please notify us immediately by email and delete the original m= essage. --_000_9B71D1415ABDF042ADF9FF4DCF793AA6579E74B4mvmexp01tptimtn_--