From issues-return-192237-archive-asf-public=cust-asf.ponee.io@spark.apache.org Tue May 22 07:00:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9856418077B for ; Tue, 22 May 2018 07:00:26 +0200 (CEST) Received: (qmail 5583 invoked by uid 500); 22 May 2018 05:00:25 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 5558 invoked by uid 99); 22 May 2018 05:00:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2018 05:00:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0FF78C0C7E for ; Tue, 22 May 2018 03:44:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id zsieQ1fGrYkZ for ; Tue, 22 May 2018 03:44:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E62EB5F35A for ; Tue, 22 May 2018 03:44:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 714C8E0F8D for ; Tue, 22 May 2018 03:44:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2FDD1217A2 for ; Tue, 22 May 2018 03:44:00 +0000 (UTC) Date: Tue, 22 May 2018 03:44:00 +0000 (UTC) From: "Chaoran Yu (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-24338) Spark SQL fails to create a table in Hive when running in a Apache Sentry-secured Environment 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/SPARK-24338?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Chaoran Yu updated SPARK-24338: ------------------------------- Description:=20 This [commit|https://github.com/apache/spark/commit/ce13c2672318242748f7520= ed4ce6bcfad4fb428]=C2=A0introduced a bug that caused Spark SQL "CREATE TABL= E"=C2=A0statement to fail in Hive when Apache Sentry is used to control clu= ster authorization. This bug exists in Spark 2.1.0 and all later releases. = The error message thrown is in the attached file.[^exception.txt] Cloudera in their fork of Spark fixed this bug as=C2=A0shown [here|https://= github.com/cloudera/spark/blob/spark2-2.2.0-cloudera2/sql/hive/src/main/sca= la/org/apache/spark/sql/hive/HiveExternalCatalog.scala#L229]. It would make= sense for this fix to be merged back upstream. was: This [commit|https://github.com/apache/spark/commit/ce13c2672318242748f7520= ed4ce6bcfad4fb428]=C2=A0introduced a bug that caused Spark SQL "CREATE TABL= E"=C2=A0statement to fail in Hive when Apache Sentry is used to control clu= ster authorization. This bug exists in Spark 2.1.0 and all later releases. = The error message thrown is the following: org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.= HiveException: MetaException(message:User soadusr does not have privileges = for CREATETABLE); at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCa= talog.scala:106) at org.apache.spark.sql.hive.HiveExternalCatalog.doCreateTable(HiveExterna= lCatalog.scala:215) at org.apache.spark.sql.catalyst.catalog.ExternalCatalog.createTable(Exter= nalCatalog.scala:110) at org.apache.spark.sql.catalyst.catalog.SessionCatalog.createTable(Sessio= nCatalog.scala:316) at org.apache.spark.sql.execution.command.CreateTableCommand.run(tables.sc= ala:127) at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectRe= sult$lzycompute(commands.scala:58) at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectRe= sult(commands.scala:56) at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeColle= ct(commands.scala:67) at org.apache.spark.sql.Dataset.(Dataset.scala:182) at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:67) at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:623) at org.apache.spark.sql.SQLContext.sql(SQLContext.scala:691) at test.HiveTestJob$.runJob(HiveTestJob.scala:86) at test.HiveTestJob$.runJob(HiveTestJob.scala:73) at spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActo= r$$getJobFuture$8.apply(JobManagerActor.scala:407) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Fu= ture.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala= :24) at monitoring.MdcPropagatingExecutionContext$$anon$1.run(MdcPropagatingExe= cutionContext.scala:24) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.ja= va:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j= ava:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(= message:User soadusr does not have privileges for CREATETABLE) at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:720) at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.= apply$mcV$sp(HiveClientImpl.scala:446) at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.= apply(HiveClientImpl.scala:446) at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.= apply(HiveClientImpl.scala:446) at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$withHiveState$= 1.apply(HiveClientImpl.scala:290) at org.apache.spark.sql.hive.client.HiveClientImpl.liftedTree1$1(HiveClien= tImpl.scala:231) at org.apache.spark.sql.hive.client.HiveClientImpl.retryLocked(HiveClientI= mpl.scala:230) at org.apache.spark.sql.hive.client.HiveClientImpl.withHiveState(HiveClien= tImpl.scala:273) at org.apache.spark.sql.hive.client.HiveClientImpl.createTable(HiveClientI= mpl.scala:445) at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.= apply$mcV$sp(HiveExternalCatalog.scala:256) at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.= apply(HiveExternalCatalog.scala:215) at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.= apply(HiveExternalCatalog.scala:215) at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCa= talog.scala:97) ... 20 more Caused by: MetaException(message:User soadusr does not have privileges for = CREATETABLE) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_w= ith_environment_context_result$create_table_with_environment_context_result= StandardScheme.read(ThriftHiveMetastore.java:29983) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_w= ith_environment_context_result$create_table_with_environment_context_result= StandardScheme.read(ThriftHiveMetastore.java:29951) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_w= ith_environment_context_result.read(ThriftHiveMetastore.java:29877) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_cr= eate_table_with_environment_context(ThriftHiveMetastore.java:1075) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.create_= table_with_environment_context(ThriftHiveMetastore.java:1061) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_= environment_context(HiveMetaStoreClient.java:2050) at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_ta= ble_with_environment_context(SessionHiveMetaStoreClient.java:97) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMe= taStoreClient.java:669) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMe= taStoreClient.java:657) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja= va:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso= rImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(Retryin= gMetaStoreClient.java:156) at com.sun.proxy.$Proxy21.createTable(Unknown Source) at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:714) ... 32 more=C2=A0 > Spark SQL fails to create a table in Hive when running in a Apache Sentry= -secured Environment > -------------------------------------------------------------------------= -------------------- > > Key: SPARK-24338 > URL: https://issues.apache.org/jira/browse/SPARK-24338 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.3.0 > Reporter: Chaoran Yu > Priority: Critical > Attachments: exception.txt > > > This [commit|https://github.com/apache/spark/commit/ce13c2672318242748f75= 20ed4ce6bcfad4fb428]=C2=A0introduced a bug that caused Spark SQL "CREATE TA= BLE"=C2=A0statement to fail in Hive when Apache Sentry is used to control c= luster authorization. This bug exists in Spark 2.1.0 and all later releases= . The error message thrown is in the attached file.[^exception.txt] > Cloudera in their fork of Spark fixed this bug as=C2=A0shown [here|https:= //github.com/cloudera/spark/blob/spark2-2.2.0-cloudera2/sql/hive/src/main/s= cala/org/apache/spark/sql/hive/HiveExternalCatalog.scala#L229]. It would ma= ke sense for this fix to be merged back upstream. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org