ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-12788. Hive view's Visual Explain panel does not work (Pallav Kulshreshtha via srimanth)
Date Mon, 24 Aug 2015 20:46:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 7be596ab0 -> ca4a57f00


AMBARI-12788. Hive view's Visual Explain panel does not work (Pallav Kulshreshtha via srimanth)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ca4a57f0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ca4a57f0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ca4a57f0

Branch: refs/heads/branch-2.1
Commit: ca4a57f008c09ca4813b5d08be2bf93952c8c488
Parents: 7be596a
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Mon Aug 24 12:10:27 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Mon Aug 24 12:10:27 2015 -0700

----------------------------------------------------------------------
 .../main/resources/ui/hive-web/app/controllers/index.js  | 11 +++++++++++
 .../ui/hive-web/app/controllers/visual-explain.js        |  9 +++++++++
 .../main/resources/ui/hive-web/app/initializers/i18n.js  |  6 ++++++
 .../ui/hive-web/app/templates/visual-explain.hbs         |  6 +++++-
 4 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca4a57f0/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
index 72fd37c..2519df1 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
@@ -165,6 +165,17 @@ export default Ember.Controller.extend({
 
     query = this.buildQuery(query, shouldExplain, shouldGetVisualExplain);
 
+
+    // Condition for no query.
+    if(query === ';') {
+      originalModel.set('isEmptyQuery', true);
+      originalModel.set('isRunning', false);
+      defer.reject({
+        message: 'No query to process.'
+      });
+      return defer.promise;
+    }
+
     // for now we won't support multiple queries
     // buildQuery will return false it multiple queries
     // are selected

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca4a57f0/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js
index 7ca6804..be14687 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js
@@ -21,6 +21,7 @@ import constants from 'hive/utils/constants';
 
 export default Ember.Controller.extend({
   jobProgressService: Ember.inject.service(constants.namingConventions.jobProgress),
+  openQueries   : Ember.inject.controller(constants.namingConventions.openQueries),
   notifyService: Ember.inject.service(constants.namingConventions.notify),
 
   index: Ember.inject.controller(),
@@ -30,6 +31,13 @@ export default Ember.Controller.extend({
     onTabOpen: function () {
       var self = this;
 
+      // Empty query
+      if(this.get('openQueries.currentQuery.fileContent').length == 0){
+        this.set('json', undefined);
+        this.set('noquery', 'hive.errors.no.query');
+        return;
+      }
+
       if (!this.get('shouldChangeGraph') && this.get('json')) {
         this.set('rerender', true);
         return;
@@ -46,6 +54,7 @@ export default Ember.Controller.extend({
           self.set('json', {})
         }
       }, function (error) {
+        self.set('json', undefined);
         self.get('notifyService').error(error);
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca4a57f0/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
index af5e3a7..1ce3d9d 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js
@@ -230,6 +230,12 @@ TRANSLATIONS = {
     }
   },
 
+  hive: {
+    errors: {
+      'no.query': "No query to process."
+    }
+  },
+
   emptyList: {
     history: {
       noItems: "No queries were run.",

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca4a57f0/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
index a415b2c..119d95d 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
@@ -20,7 +20,11 @@
   {{#panel-widget headingTranslation="titles.query.visualExplain"}}
 
   {{#unless json}}
-    <div class="spinner"></div>
+    {{#if noquery}}
+      <div class="alert alert-danger" role="alert"><strong>{{tb-helper 'hive.errors.no.query'}}</strong></div>
+    {{else}}
+      <div class="spinner"></div>
+    {{/if}}
   {{/unless}}
 
   <div id="no-visual-explain-graph"></div>


Mime
View raw message