Browse Source

HUE-415. beeswax doesn't honour hive_conf_dir

* Fixed error when the design cannot be found.
bc Wong 15 years ago
parent
commit
76eb813d24

+ 2 - 2
apps/beeswax/beeswax_server.sh

@@ -36,7 +36,7 @@ BEESWAX_HIVE_LIB=$BEESWAX_ROOT/hive/lib
 
 echo \$HADOOP_HOME=$HADOOP_HOME
 
-export HADOOP_CLASSPATH=$(find $BEESWAX_HIVE_LIB -name "*.jar" | tr "\n" :):$HIVE_CONF_DIR
+export HADOOP_CLASSPATH=$(find $BEESWAX_HIVE_LIB -name "*.jar" | tr "\n" :)
 
 if [ -n "$HADOOP_EXTRA_CLASSPATH_STRING" ]; then
   export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HADOOP_EXTRA_CLASSPATH_STRING
@@ -56,7 +56,7 @@ fi
 if [ -f $HADOOP_CONF_DIR/hadoop-env.sh ]; then
   . $HADOOP_CONF_DIR/hadoop-env.sh
 fi
-export HADOOP_CONF_DIR=$BEESWAX_ROOT/../../desktop/conf:${BEESWAX_HIVE_LIB}/hive-default-xml-0.6.0.jar:${HADOOP_CONF_DIR}:$(find $BEESWAX_HIVE_LIB -name "thrift-fb303-0.5.0.jar" | head -1)
+export HADOOP_CONF_DIR=$HIVE_CONF_DIR:${BEESWAX_HIVE_LIB}/hive-default-xml-0.6.0.jar:${HADOOP_CONF_DIR}:$(find $BEESWAX_HIVE_LIB -name "thrift-fb303-0.5.0.jar" | head -1)
 echo \$HADOOP_CONF_DIR=$HADOOP_CONF_DIR
 
 # Note: I've had trouble running this with just "java -jar" with the classpath

+ 7 - 5
apps/beeswax/src/beeswax/templates/list_history.mako

@@ -53,7 +53,7 @@ ${wrappers.head("Beeswax: Query History", section='history')}
   ${comps.pagination(page)}
 
   <div class="bw-show_group toolbar">
-      Show: 
+      Show:
     % if filter_params.get('user') == '_all':
       <%
         my_querydict = filter_params.copy()
@@ -100,11 +100,13 @@ ${wrappers.head("Beeswax: Query History", section='history')}
       from beeswax import models, views
     %>
     % for query in page.object_list:
-      <% 
+      <%
         qcontext = ""
-        design = query.design 
-        if design:
+	try:
+	  design = query.design
           qcontext = views.make_query_context('design', design.id)
+	except:
+	  pass
       %>
       <tr data-dblclick-delegate="{'dblclick_loads':'.bw-view_result'}" class="jframe-no_select hue-help_links_small">
         <td>${query.submission_date.strftime("%x %X")}</td>
@@ -121,7 +123,7 @@ ${wrappers.head("Beeswax: Query History", section='history')}
         <td>${query.owner}</td>
         <td>${models.QueryHistory.STATE[query.last_state]}</td>
         <td class="bw-query_result">
-          % if query.last_state != models.QueryHistory.STATE.expired.index:
+          % if qcontext and query.last_state != models.QueryHistory.STATE.expired.index:
             <a href="${ url('beeswax.views.watch_query', id=query.id) }?context=${qcontext|u}" class="bw-view_result" data-filters="ArtButton" data-icon-styles="{'width': 16, 'height': 16, 'top': 2}">Results</a>
           % else:
             ~

+ 7 - 3
apps/beeswax/src/beeswax/templates/my_queries.mako

@@ -113,8 +113,12 @@ ${wrappers.head("Beeswax: My Queries", section='my queries')}
           %>
           % for query in h_page.object_list:
             <%
-              design = query.design
-              qcontext = views.make_query_context('design', design.id)
+	      qcontext = ""
+	      try:
+		design = query.design
+		qcontext = views.make_query_context('design', design.id)
+	      except:
+		pass
             %>
             <tr data-dblclick-delegate="{'dblclick_loads':'.bw-view_result'}" class="jframe-no_select hue-help_links_small">
               <td>${query.submission_date.strftime("%x %X")}</td>
@@ -131,7 +135,7 @@ ${wrappers.head("Beeswax: My Queries", section='my queries')}
               </td>
               <td>${models.QueryHistory.STATE[query.last_state]}</td>
               <td class="bw-query_result">
-                % if query.last_state != models.QueryHistory.STATE.expired.index:
+                % if qcontext and query.last_state != models.QueryHistory.STATE.expired.index:
                   <a href="${ url('beeswax.views.watch_query', id=query.id) }?context=${qcontext|u}" class="bw-view_result" data-filters="ArtButton" data-icon-styles="{'width': 16, 'height': 16, 'top': 2}">View</a>
                 % else:
                   ~