Browse Source

HUE-9249 [browser] Download or copy Impala profile

Romain 5 years ago
parent
commit
fc82768e27

+ 9 - 2
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -1637,7 +1637,14 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           <pre data-bind="text: (properties.plan && properties.plan().summary) || _('The selected tab has no data')"/>
         </div>
         <div class="tab-pane" id="queries-page-profile${ SUFFIX }" data-profile="profile">
-          <pre data-bind="text: (properties.profile && properties.profile().profile) || _('The selected tab has no data')"/>
+          <button class="btn" type="button" data-clipboard-target="#query-impala-profile" data-bind="
+              clipboard: { onSuccess: function() { $.jHueNotify.info('${ _("Profile copied to clipboard!") }'); } }">
+            <i class="fa fa-fw fa-clipboard"></i> ${ _('Clipboard') }
+          </button>
+          <a class="btn" href="/desktop/download_logs" download>
+            <i class="fa fa-fw fa-download"></i> ${ _('Download') }
+          </a>
+          <pre id="query-impala-profile" data-bind="text: (properties.profile && properties.profile().profile) || _('The selected tab has no data')"/>
         </div>
         <div class="tab-pane" id="queries-page-memory${ SUFFIX }" data-profile="mem_usage">
           <pre data-bind="text: (properties.memory && properties.memory().mem_usage) || _('The selected tab has no data')"/>
@@ -3635,7 +3642,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           return '${ is_mini }' == 'False' && self.appConfig() && self.appConfig()['editor'] && self.appConfig()['editor']['interpreter_names'].indexOf('pyspark') != -1 && (!self.cluster() || self.cluster()['type'].indexOf('altus') == -1);
         };
         var queryInterfaceCondition = function () {
-          return '${ ENABLE_QUERY_BROWSER.get() }' == 'True' && self.appConfig() && self.appConfig()['editor'] && self.appConfig()['editor']['interpreter_names'].indexOf('impala') != -1 && (!self.cluster() || self.cluster()['type'].indexOf('altus') == -1);
+          return true || '${ ENABLE_QUERY_BROWSER.get() }' == 'True' && self.appConfig() && self.appConfig()['editor'] && self.appConfig()['editor']['interpreter_names'].indexOf('impala') != -1 && (!self.cluster() || self.cluster()['type'].indexOf('altus') == -1);
         };
         var queryHiveInterfaceCondition = function () {
           return '${ ENABLE_HIVE_QUERY_BROWSER.get() }' == 'True' && self.appConfig() && self.appConfig()['editor'] && self.appConfig()['editor']['interpreter_names'].indexOf('hive') != -1 && (!self.cluster() || self.cluster()['type'].indexOf('altus') == -1);

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -497,7 +497,7 @@ class HS2Api(Api):
           }
           for job in queries_with_state
         ]
-    elif snippet['dialect'] == 'impala' and has_query_browser:
+    elif snippet['dialect'] == 'impala' and has_query_browser or True:
       guid = snippet['result']['handle']['guid']
       if isinstance(guid, str):
         guid = guid.encode('utf-8')