diff -ur hue-beeswax-1.0.1/java/src/com/cloudera/beeswax/BeeswaxServiceImpl.java hue-beeswax-1.0.1.patched/java/src/com/cloudera/beeswax/BeeswaxServiceImpl.java
--- hue-beeswax-1.0.1/java/src/com/cloudera/beeswax/BeeswaxServiceImpl.java	2011-01-12 17:21:06.516718486 -0800
+++ hue-beeswax-1.0.1.patched/java/src/com/cloudera/beeswax/BeeswaxServiceImpl.java	2011-01-12 17:21:04.647838815 -0800
@@ -51,10 +51,9 @@
 import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.metadata.Hive;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
-import org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer;
 import org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer;
-import org.apache.hadoop.hive.ql.plan.fetchWork;
-import org.apache.hadoop.hive.ql.plan.tableDesc;
+import org.apache.hadoop.hive.ql.plan.FetchWork;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
 import org.apache.hadoop.hive.ql.processors.CommandProcessor;
 import org.apache.hadoop.hive.ql.processors.CommandProcessorFactory;
 import org.apache.hadoop.hive.ql.QueryPlan;
@@ -210,9 +209,9 @@
         CommandProcessor p = CommandProcessorFactory.get(tokens[0]);
         int res;
         if (p instanceof Driver) {
-          res = p.run(cmd);
+          res = p.run(cmd).getResponseCode();
         } else {
-          res = p.run(cmd1);
+          res = p.run(cmd1).getResponseCode();
         }
         if (res != 0) {
           throwException(new RuntimeException(getErrorStreamAsString()));
@@ -314,7 +313,7 @@
     }
 
     private void materializeResults(Results r, boolean startOver) throws IOException {
-      if (driver.getPlan().getPlan().getFetchTask() == null) {
+      if (driver.getPlan().getFetchTask() == null) {
         // This query is never going to return anything.
         r.has_more = false;
         r.setData(Collections.<String>emptyList());
@@ -324,11 +323,11 @@
 
       if (startOver) {
         // This is totally inappropriately reaching into internals.
-        driver.getPlan().getPlan().getFetchTask().initialize(hiveConf,
-            driver.getPlan());
+        driver.getPlan().getFetchTask().initialize(hiveConf,
+            driver.getPlan(), null);
         startRow = 0;
       }
-      Vector<String> v = new Vector<String>();
+      ArrayList<String> v = new ArrayList<String>();
       r.setData(v);
       r.has_more = driver.getResults(v);
       r.start_row = startRow;
@@ -356,8 +355,8 @@
         LOG.error("Error getting schema for query: " + query.query, ex);
       }
 
-      fetchWork work = getFetchWork();
-      tableDesc desc = work.getTblDesc();
+      FetchWork work = getFetchWork();
+      TableDesc desc = work.getTblDesc();
       String tabledir = null;
       String tablename = null;
       String sep = null;
@@ -376,25 +375,19 @@
     /**
      * Get the fetchWork. Only SELECTs have them.
      */
-    synchronized private fetchWork getFetchWork() {
+    synchronized private FetchWork getFetchWork() {
       QueryPlan plan = driver.getPlan();
       FetchTask fetchTask = null;
       if (plan != null) {
-        BaseSemanticAnalyzer sem = plan.getPlan();
-        if (sem.getFetchTask() != null) {
-          if (!sem.getFetchTaskInit()) {
-            sem.setFetchTaskInit(true);
-            sem.getFetchTask().initialize(hiveConf, plan);
-          }
-          fetchTask = (FetchTask) sem.getFetchTask();
+        fetchTask = plan.getFetchTask();
+        if (fetchTask != null) {
+            fetchTask.initialize(hiveConf, plan, null);
         }
       }
-
       if (fetchTask == null) {
         return null;
       }
-
-      fetchWork work = (fetchWork) fetchTask.getWork();
+      FetchWork work = fetchTask.getWork();
       return work;
     }
 
@@ -403,16 +396,12 @@
       // By manipulating the query, this will make errors harder to find.
       query.query = "EXPLAIN " + query.query;
       checkedCompile();
-      if (!(driver.getPlan().getPlan() instanceof ExplainSemanticAnalyzer)) {
-        throwException(new RuntimeException("Expected explain plan."));
-      }
-
       int ret;
       if (0 != (ret = driver.execute())) {
         throwException(new RuntimeException("Failed to execute: EXPLAIN " + ret));
       }
       StringBuilder sb = new StringBuilder();
-      Vector<String> v = new Vector<String>();
+      ArrayList<String> v = new ArrayList<String>();
       try {
         while (driver.getResults(v)) {
           for (String s : v) {
