[ 
https://issues.apache.org/jira/browse/HIVE-24751?focusedWorklogId=556455&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-556455
 ]

ASF GitHub Bot logged work on HIVE-24751:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Feb/21 16:52
            Start Date: 23/Feb/21 16:52
    Worklog Time Spent: 10m 
      Work Description: guptanikhil007 commented on a change in pull request 
#1964:
URL: https://github.com/apache/hive/pull/1964#discussion_r581208732



##########
File path: 
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestKillQueryWithAuthorizationDisabled.java
##########
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.jdbc;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.ddl.process.kill.KillQueriesOperation;
+import org.apache.hadoop.hive.ql.exec.UDF;
+import org.apache.hive.jdbc.miniHS2.MiniHS2;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+public class TestKillQueryWithAuthorizationDisabled{
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(TestKillQueryWithAuthorizationDisabled.class);

Review comment:
       Fixed the Code Style as per dev-support/eclipse-styles.xml;




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 556455)
    Time Spent: 1h 20m  (was: 1h 10m)

> Kill trigger in workload manager fails with "No privilege" exception when 
> authorization is disabled.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-24751
>                 URL: https://issues.apache.org/jira/browse/HIVE-24751
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: Nikhil Gupta
>            Assignee: Nikhil Gupta
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> At present it is not checked whether authorization is enabled or not for Kill 
> Query access. 
>  This causes Workload Manager thread to end up with No privilege Exception 
> when trying to kill a query in an environment where authorization is disabled.
> {code:java}
> org.apache.hadoop.hive.ql.metadata.HiveException: No privilege
>  at 
> org.apache.hive.service.server.KillQueryImpl.killQuery(KillQueryImpl.java:188)
>  at 
> org.apache.hadoop.hive.ql.exec.tez.WorkloadManager.lambda$scheduleWork$3(WorkloadManager.java:454)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
>  Caused by: org.apache.hive.service.cli.HiveSQLException: No privilege
>  at 
> org.apache.hive.service.server.KillQueryImpl.killQuery(KillQueryImpl.java:167)
>  ... 6 more{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to