Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4E6418EB9 for ; Fri, 31 Jul 2015 23:23:04 +0000 (UTC) Received: (qmail 64359 invoked by uid 500); 31 Jul 2015 23:23:04 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 64337 invoked by uid 500); 31 Jul 2015 23:23:04 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 64325 invoked by uid 99); 31 Jul 2015 23:23:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 23:23:04 +0000 Date: Fri, 31 Jul 2015 23:23:04 +0000 (UTC) From: "Grisha Trubetskoy (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-11427) Location of temporary table for CREATE TABLE SELECT broken by HIVE-7079 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-11427?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Grisha Trubetskoy updated HIVE-11427: ------------------------------------- Description:=20 If a user _does not_ have HDFS write permissions to the _default_ database,= and attempts to create a table in a _private_ database to which the user _= does_ have permissions, the following happens: {code} create table grisha.blahblah as select * from some_table; FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://nn= .example.com/user/hive/warehouse. Error encountered near token 'TOK_TMP_FIL= E=E2=80=99 I've edited this issue because my initial explanation was completely bogus.= A more likely explanation is in https://github.com/apache/hive/commit/1614= 314ef7bd0c3b8527ee32a434ababf7711278 {code} - fname =3D ctx.getExternalTmpPath( + fname =3D ctx.getExtTmpPathRelTo( {code} In any event - the bug is that the location chosen for the temporary storag= e has to be in the same place as the target table because that is where pre= sumably the user running the query would have write permissions to. was: If a user _does not_ have HDFS write permissions to the _default_ database,= and attempts to create a table in a _private_ database to which the user _= does_ have permissions, the following happens: {code} create table grisha.blahblah as select * from some_table; FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://nn= .example.com/user/hive/warehouse. Error encountered near token 'TOK_TMP_FIL= E=E2=80=99 {code} The reason for this seems to be https://github.com/apache/hive/commit/05a2a= ff71c2682e01331cd333189ce7802233a75#diff-f2040374293a91cbcc6594ee571b20e4L1= 425, specifically this line: https://github.com/apache/hive/blob/branch-0.1= 4/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L1787, = which changed like this in the aforementioned commit: {code} - location =3D wh.getDatabasePath(db.getDatabase(newTable.ge= tDbName())); + location =3D wh.getDatabasePath(db.getDatabase(names[0])); {code} So before the database of the new table was used, and now the database of t= he table from the select is used as I understand it. NB: This was all inferred from just reading the code, I have not verified i= t. > Location of temporary table for CREATE TABLE SELECT broken by HIVE-7079 > ------------------------------------------------------------------------ > > Key: HIVE-11427 > URL: https://issues.apache.org/jira/browse/HIVE-11427 > Project: Hive > Issue Type: Bug > Reporter: Grisha Trubetskoy > > If a user _does not_ have HDFS write permissions to the _default_ databas= e, and attempts to create a table in a _private_ database to which the user= _does_ have permissions, the following happens: > {code} > create table grisha.blahblah as select * from some_table; > FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://= nn.example.com/user/hive/warehouse. Error encountered near token 'TOK_TMP_F= ILE=E2=80=99 > I've edited this issue because my initial explanation was completely bogu= s. A more likely explanation is in https://github.com/apache/hive/commit/16= 14314ef7bd0c3b8527ee32a434ababf7711278 > {code} > - fname =3D ctx.getExternalTmpPath( > + fname =3D ctx.getExtTmpPathRelTo( > {code} > In any event - the bug is that the location chosen for the temporary stor= age has to be in the same place as the target table because that is where p= resumably the user running the query would have write permissions to. -- This message was sent by Atlassian JIRA (v6.3.4#6332)