Browse Source

[impala] Progress log support

Only when using the Hive Server 2 interface
Romain Rigaux 12 years ago
parent
commit
89e732a

+ 2 - 5
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -557,11 +557,8 @@ class HiveServerClientCompatible:
 
 
   def get_log(self, handle):
-    if self.query_server['server_name'] == 'impala':
-      return 'Impala does not support GetLog()'
-    else:
-      operationHandle = handle.get_rpc_handle()
-      return self._client.get_log(operationHandle)
+    operationHandle = handle.get_rpc_handle()
+    return self._client.get_log(operationHandle)
 
 
   def get_databases(self):

+ 7 - 4
apps/beeswax/src/beeswax/templates/watch_wait.mako

@@ -72,7 +72,6 @@ ${layout.menubar(section='query')}
 </div>
 
 <script>
-
   $(document).ready(function(){
     var fwdUrl = "${url(app_name + ':watch_query', query.id)}?${fwd_params}";
     var labels = {
@@ -97,8 +96,13 @@ ${layout.menubar(section='query')}
           }
         }
         var _logsEl = $("#log pre");
-        var newLines = data.log.split("\n").slice(_logsEl.text().split("\n").length);
-        _logsEl.text(_logsEl.text() + newLines.join("\n"));
+        % if app_name == 'impala':
+          _logsEl.text($.trim(data.log));
+        % else:
+          var newLines = data.log.split("\n").slice(_logsEl.text().split("\n").length);
+          _logsEl.text(_logsEl.text() + newLines.join("\n"));
+        % endif
+
         if (logsAtEnd) {
           _logsEl.scrollTop(_logsEl[0].scrollHeight - _logsEl.height());
         }
@@ -128,7 +132,6 @@ ${layout.menubar(section='query')}
     }
 
   });
-
 </script>