This is an automated email from the ASF dual-hosted git repository.

kasakrisz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 227d8da1b11 HIVE-29966: Remove skip method in CommandAuthorizer (#6855)
227d8da1b11 is described below

commit 227d8da1b11ad039b026916caa6fe5bb6a6a825a
Author: Dayakar M <[email protected]>
AuthorDate: Wed Oct 7 18:28:36 2026 +0530

    HIVE-29966: Remove skip method in CommandAuthorizer (#6855)
---
 .../authorization/command/CommandAuthorizer.java        | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizer.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizer.java
index 8247a33c361..a0a183c4fb7 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizer.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizer.java
@@ -44,9 +44,6 @@ private CommandAuthorizer() {
   /** @param command Passed so that authorization interface can provide more 
useful information in logs. */
   public static void doAuthorization(HiveOperation op, BaseSemanticAnalyzer 
sem, String command)
       throws HiveException, AuthorizationException {
-    if (skip(op, sem)) {
-      return;
-    }
 
     SessionState ss = SessionState.get();
 
@@ -60,20 +57,6 @@ public static void doAuthorization(HiveOperation op, 
BaseSemanticAnalyzer sem, S
     }
   }
 
-  private static boolean skip(HiveOperation op, BaseSemanticAnalyzer sem) 
throws HiveException {
-    // skipping the auth check for the "CREATE DATABASE" operation if database 
already exists
-    // we know that if the database already exists then "CREATE DATABASE" 
operation will fail.
-    if (op == HiveOperation.CREATEDATABASE) {
-      for (WriteEntity e : sem.getOutputs()) {
-        if(e.getType() == Entity.Type.DATABASE && 
sem.getDb().databaseExists(e.getName().split(":")[1])){
-          return true;
-        }
-      }
-    }
-
-    return false;
-  }
-
   private static Set<ReadEntity> getInputs(BaseSemanticAnalyzer sem) {
     Set<ReadEntity> additionalInputs = new HashSet<ReadEntity>();
     for (Entity e : sem.getAllInputs()) {

Reply via email to