[hive] branch master updated (1dc2564 -> 90ad548)

2020-09-23 Thread prasanthj
This is an automated email from the ASF dual-hosted git repository.

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


from 1dc2564  HIVE-24009 : Support partition pruning and other physical 
transformations for EXECUTE statement (Vineet Garg, reviewed by Jesus Camacho 
Rodriguez)
 add 90ad548  HIVE-24188 - CTLT from MM to External fails because table txn 
properties are not skipped (#1516)

No new revisions were added by this update.

Summary of changes:
 .../create/like/CreateTableLikeOperation.java  |   1 +
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java |   2 +-
 ql/src/test/queries/clientpositive/create_like2.q  |  32 +++
 .../results/clientpositive/llap/create_like2.q.out | 282 +
 4 files changed, 316 insertions(+), 1 deletion(-)



[hive] branch master updated: HIVE-24172: Fix TestMmCompactorOnMr (Karen Coppage, reviewed by Laszlo Pinter)

2020-09-23 Thread klcopp
This is an automated email from the ASF dual-hosted git repository.

klcopp 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 1f9a68d  HIVE-24172: Fix TestMmCompactorOnMr (Karen Coppage, reviewed 
by Laszlo Pinter)
1f9a68d is described below

commit 1f9a68ddb8e87b6efb9f23b687eaf99557376436
Author: Karen Coppage 
AuthorDate: Wed Sep 23 16:21:29 2020 +0200

HIVE-24172: Fix TestMmCompactorOnMr (Karen Coppage, reviewed by Laszlo 
Pinter)

Closes #1514.
---
 .../org/apache/hadoop/hive/ql/txn/compactor/TestMmCompactorOnMr.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestMmCompactorOnMr.java
 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestMmCompactorOnMr.java
index d6e4dfc..c24cfc3 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestMmCompactorOnMr.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestMmCompactorOnMr.java
@@ -20,10 +20,10 @@ package org.apache.hadoop.hive.ql.txn.compactor;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.junit.Before;
 
-@org.junit.Ignore("HIVE-24172")
 public class TestMmCompactorOnMr extends TestMmCompactorOnTez {
   @Before
   public void setMr() {
-driver.getConf().setVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE, "mr");
+// NOTE: only compaction will run with MR as execution engine; setup and 
teardown queries will run with Tez.
+conf.setVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE, "mr");
   }
 }



[hive] branch master updated: HIVE-24182: Fix ranger authorization issue with permanent UDF(Kishen Das via Thejas Nair and Naveen Gangam)

2020-09-23 Thread ngangam
This is an automated email from the ASF dual-hosted git repository.

ngangam 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 2fccdf1  HIVE-24182: Fix ranger authorization issue with permanent 
UDF(Kishen Das via Thejas Nair and Naveen Gangam)
2fccdf1 is described below

commit 2fccdf1cde50a0d326e4b95e1c3dfae9e8d44af6
Author: Kishen Das 
AuthorDate: Sat Sep 19 03:13:57 2020 -0700

HIVE-24182: Fix ranger authorization issue with permanent UDF(Kishen Das 
via Thejas Nair and Naveen Gangam)
---
 .../plugin/TestHiveAuthorizerCheckInvocation.java  | 19 ++
 .../apache/hadoop/hive/ql/exec/FunctionUtils.java  |  4 ++
 .../org/apache/hadoop/hive/ql/exec/Registry.java   |  2 +-
 .../hadoop/hive/ql/exec/TestFunctionUtils.java | 43 ++
 4 files changed, 67 insertions(+), 1 deletion(-)

diff --git 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
index 79d494f..d046822 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.metastore.txn.TxnDbUtil;
 import org.apache.hadoop.hive.ql.Driver;
+import org.apache.hadoop.hive.ql.exec.Registry;
 import org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
 import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider;
 import org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator;
@@ -221,6 +222,24 @@ public class TestHiveAuthorizerCheckInvocation {
   }
 
   @Test
+  public void testWindowingFunction() throws Exception {
+
+reset(mockedAuthorizer);
+int status = driver.compile("select AVG(`i`) OVER (PARTITION BY `city`) AS 
iavg FROM " + tableName, true);
+assertEquals(0, status);
+
+List inputs = 
getHivePrivilegeObjectInputs().getLeft();
+checkSingleTableInput(inputs);
+HivePrivilegeObject tableObj = inputs.get(0);
+// Make sure none of the hive privilege object contain DB name with 
WINDOW_FUNC_PREFIX prefix.
+for (HivePrivilegeObject obj : inputs) {
+  assertTrue(!obj.getDbname().startsWith(Registry.WINDOW_FUNC_PREFIX));
+}
+assertEquals("no of columns used", 2, tableObj.getColumns().size());
+assertEquals("Columns used", Arrays.asList("city", "i"), 
getSortedList(tableObj.getColumns()));
+  }
+
+  @Test
   public void testCreateTableWithDb() throws Exception {
 final String newTable = "ctTableWithDb";
 checkCreateViewOrTableWithDb(newTable, "create table " + dbName + "." + 
newTable + "(i int)");
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionUtils.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionUtils.java
index c86954c..9a91639 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionUtils.java
@@ -126,6 +126,10 @@ public final class FunctionUtils {
 } else if (names.length > 2) {
   throw new HiveException("Function name does not have correct format: " + 
functionName);
 }
+// Remove the WINDOW_FUNC_PREFIX prefix, as that is not part of the 
database name.
+if (names[0].startsWith(Registry.WINDOW_FUNC_PREFIX)) {
+  names[0] = names[0].substring(Registry.WINDOW_FUNC_PREFIX.length());
+}
 return names;
   }
 
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
index 1f6ae08..d686cf5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
@@ -73,7 +73,7 @@ public class Registry {
   private static final Logger LOG = 
LoggerFactory.getLogger(FunctionRegistry.class);
 
   // prefix for window functions, to discern LEAD/LAG UDFs from window 
functions with the same name
-  private static final String WINDOW_FUNC_PREFIX = "@_";
+  public static final String WINDOW_FUNC_PREFIX = "@_";
 
   /**
* The mapping from expression function names to expression classes.
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/TestFunctionUtils.java 
b/ql/src/test/org/apache/hadoop/hive/ql/exec/TestFunctionUtils.java
new file mode 100644
index 000..39a36e7
--- /dev/null
+++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/TestFunctionUtils.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with