You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2014/04/10 00:57:06 UTC

svn commit: r1586168 - in /hive/branches/branch-0.13/hcatalog: core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java

Author: thejas
Date: Wed Apr  9 22:57:06 2014
New Revision: 1586168

URL: http://svn.apache.org/r1586168
Log:
HIVE-6856 : ddl commands fail with permissions issue when running using webhcat in secure Tez cluster (Eugene Koifman via Thejas Nair)

Modified:
    hive/branches/branch-0.13/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java
    hive/branches/branch-0.13/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java

Modified: hive/branches/branch-0.13/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java?rev=1586168&r1=1586167&r2=1586168&view=diff
==============================================================================
--- hive/branches/branch-0.13/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java (original)
+++ hive/branches/branch-0.13/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java Wed Apr  9 22:57:06 2014
@@ -38,6 +38,8 @@ import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.Parser;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hive.cli.CliSessionState;
 import org.apache.hadoop.hive.common.LogUtils;
@@ -53,6 +55,8 @@ import org.apache.hive.hcatalog.common.H
 import org.apache.hive.hcatalog.common.HCatUtil;
 
 public class HCatCli {
+  private static Log LOG = null;
+
 
   @SuppressWarnings("static-access")
   public static void main(String[] args) {
@@ -62,6 +66,7 @@ public class HCatCli {
     } catch (LogInitializationException e) {
 
     }
+    LOG = LogFactory.getLog(HCatCli.class);
 
     CliSessionState ss = new CliSessionState(new HiveConf(SessionState.class));
     ss.in = System.in;
@@ -75,6 +80,12 @@ public class HCatCli {
     HiveConf conf = ss.getConf();
 
     HiveConf.setVar(conf, ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName());
+    String engine = HiveConf.getVar(conf, ConfVars.HIVE_EXECUTION_ENGINE);
+    final String MR_ENGINE = "mr";
+    if(!MR_ENGINE.equalsIgnoreCase(engine)) {
+      HiveConf.setVar(conf, ConfVars.HIVE_EXECUTION_ENGINE, MR_ENGINE);
+      LOG.info("Forcing " + ConfVars.HIVE_EXECUTION_ENGINE + " to " + MR_ENGINE);
+    }
 
     Options options = new Options();
 

Modified: hive/branches/branch-0.13/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java?rev=1586168&r1=1586167&r2=1586168&view=diff
==============================================================================
--- hive/branches/branch-0.13/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java (original)
+++ hive/branches/branch-0.13/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java Wed Apr  9 22:57:06 2014
@@ -19,7 +19,6 @@
 package org.apache.hive.hcatalog.templeton;
 
 import java.io.File;
-import java.io.StringBufferInputStream;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;