소스 검색

[Beeswax] Fix Hive-0.8.1 compatibility

bc Wong 13 년 전
부모
커밋
36352d3602

+ 4 - 4
apps/beeswax/java/pom.xml

@@ -41,18 +41,18 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-core</artifactId>
+      <artifactId>hadoop-client</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.hadoop.hive</groupId>
+      <groupId>org.apache.hive</groupId>
       <artifactId>hive-metastore</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.hadoop.hive</groupId>
+      <groupId>org.apache.hive</groupId>
       <artifactId>hive-exec</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.hadoop.hive</groupId>
+      <groupId>org.apache.hive</groupId>
       <artifactId>hive-common</artifactId>
     </dependency>
     <dependency>

+ 12 - 8
apps/beeswax/java/src/main/java/com/cloudera/beeswax/BeeswaxServiceImpl.java

@@ -46,10 +46,10 @@ import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLContext;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.metastore.api.Schema;
+import org.apache.hadoop.hive.ql.CommandNeedRetryException;
 import org.apache.hadoop.hive.ql.Driver;
 import org.apache.hadoop.hive.ql.exec.FetchTask;
 import org.apache.hadoop.hive.ql.exec.TaskFactory;
@@ -182,7 +182,8 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
       }
     }
 
-    synchronized public void compile() throws BeeswaxException {
+    synchronized public void compile()
+    throws BeeswaxException, CommandNeedRetryException {
       try {
         assertState(QueryState.INITIALIZED);
         checkedCompile();
@@ -208,7 +209,8 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
       throw ex;
     }
 
-    private void checkedCompile() throws BeeswaxException {
+    private void checkedCompile()
+    throws BeeswaxException, CommandNeedRetryException {
       // Run through configuration commands
       for (String cmd : query.configuration) {
         // This is pretty whacky; SET and ADD get treated differently
@@ -218,7 +220,7 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
         String[] tokens = cmd_trimmed.split("\\s+");
         String cmd1 = cmd_trimmed.substring(tokens[0].length()).trim();
         CommandProcessor p = CommandProcessorFactory.get(tokens[0]);
-        int res;
+        int res = -1;
         if (p instanceof Driver) {
           res = p.run(cmd).getResponseCode();
         } else {
@@ -301,7 +303,7 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
      * Executes query. Updates state. (QueryState variable can be polled.)
      * @throws BeeswaxException
      */
-    public void execute() throws BeeswaxException {
+    public void execute() throws BeeswaxException, CommandNeedRetryException {
       synchronized (this) {
         assertState(QueryState.COMPILED);
         state = QueryState.RUNNING;
@@ -333,7 +335,8 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
       SessionState.start(this.sessionState);
     }
 
-    private void materializeResults(Results r, boolean startOver) throws IOException {
+    private void materializeResults(Results r, boolean startOver)
+    throws IOException, CommandNeedRetryException {
       if (driver.getPlan().getFetchTask() == null) {
         // This query is never going to return anything.
         r.has_more = false;
@@ -420,7 +423,8 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
       return work;
     }
 
-    synchronized public QueryExplanation explain() throws BeeswaxException {
+    synchronized public QueryExplanation explain()
+    throws BeeswaxException, CommandNeedRetryException {
       assertState(QueryState.INITIALIZED);
       // By manipulating the query, this will make errors harder to find.
       query.query = "EXPLAIN " + query.query;
@@ -464,7 +468,7 @@ public class BeeswaxServiceImpl implements BeeswaxService.Iface {
           r.ready = true;
           try {
             materializeResults(r, fromBeginning);
-          } catch (IOException e) {
+          } catch (Exception e) {
             throw new BeeswaxException(e.toString(), logContext.getName(), handle);
           } finally {
             cleanSessionState();

+ 1 - 1
desktop/libs/hadoop/credentials-merger/pom.xml

@@ -41,7 +41,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-core</artifactId>
+      <artifactId>hadoop-client</artifactId>
     </dependency>
   </dependencies>
 

+ 1 - 1
desktop/libs/hadoop/static-group-mapping/pom.xml

@@ -41,7 +41,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-core</artifactId>
+      <artifactId>hadoop-client</artifactId>
     </dependency>
   </dependencies>
 

+ 1 - 1
desktop/libs/hadoop/sudo-shell/pom.xml

@@ -41,7 +41,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
-      <artifactId>hadoop-core</artifactId>
+      <artifactId>hadoop-client</artifactId>
     </dependency>
   </dependencies>
 

+ 4 - 4
maven/pom.xml

@@ -43,7 +43,7 @@
 
   <properties>
     <hadoop.version>0.23.0-mr1-cdh4b2-SNAPSHOT</hadoop.version>
-    <hive.version>0.8.0-cdh4b2-SNAPSHOT</hive.version>
+    <hive.version>0.8.1-cdh4b2-SNAPSHOT</hive.version>
     <slf4j.version>1.6.1</slf4j.version>
     <commons-logging.version>1.0.4</commons-logging.version>
   </properties>
@@ -85,17 +85,17 @@
         <version>${hadoop.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.hadoop.hive</groupId>
+        <groupId>org.apache.hive</groupId>
         <artifactId>hive-metastore</artifactId>
         <version>${hive.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.hadoop.hive</groupId>
+        <groupId>org.apache.hive</groupId>
         <artifactId>hive-exec</artifactId>
         <version>${hive.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.hadoop.hive</groupId>
+        <groupId>org.apache.hive</groupId>
         <artifactId>hive-common</artifactId>
         <version>${hive.version}</version>
       </dependency>