You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2017/02/24 15:02:54 UTC
ambari git commit: AMBARI-20162. HiveView2.0: No notifications for
successful query which yields no output. (pallavkul)
Repository: ambari
Updated Branches:
refs/heads/trunk 0fd2f9f6f -> d797d99f1
AMBARI-20162. HiveView2.0: No notifications for successful query which yields no output. (pallavkul)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d797d99f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d797d99f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d797d99f
Branch: refs/heads/trunk
Commit: d797d99f1edbdf01c82635128ce1ff1c2fa875f3
Parents: 0fd2f9f
Author: pallavkul <pa...@gmail.com>
Authored: Fri Feb 24 20:31:49 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Fri Feb 24 20:32:44 2017 +0530
----------------------------------------------------------------------
.../resources/ui/app/routes/queries/query.js | 77 +++++++++-----------
.../app/routes/queries/query/visual-explain.js | 9 +--
.../src/main/resources/ui/app/services/jobs.js | 3 +-
.../ui/app/templates/queries/query/log.hbs | 8 +-
.../ui/app/templates/queries/query/results.hbs | 4 +-
.../ui/app/templates/queries/query/tez-ui.hbs | 4 +-
.../templates/queries/query/visual-explain.hbs | 9 ++-
7 files changed, 59 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
index 16103b7..efab0ad 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js
@@ -41,35 +41,6 @@ export default Ember.Route.extend(UILoggerMixin, {
this.selectDatabase(dbmodel);
}
- this.store.findAll('file-resource').then((data) => {
- let fileResourceList = [];
- data.forEach(x => {
- let localFileResource = {'id': x.get('id'),
- 'name': x.get('name'),
- 'path': x.get('path'),
- 'owner': x.get('owner')
- };
- fileResourceList.push(localFileResource);
- });
- this.controller.set('fileResourceList', fileResourceList);
- });
-
- this.store.findAll('udf').then((data) => {
- let allUDFList = [];
- data.forEach(x => {
- let localUDF = {'id': x.get('id'),
- 'name': x.get('name'),
- 'classname': x.get('classname'),
- 'fileResource': x.get('fileResource'),
- 'owner': x.get('owner')
- };
- allUDFList.push(localUDF);
- });
- this.controller.set('allUDFList', allUDFList);
- });
-
-
-
this.store.findAll('setting').then((data) => {
let localStr = '';
data.forEach(x => {
@@ -127,6 +98,34 @@ export default Ember.Route.extend(UILoggerMixin, {
selectedMultiDb.pushObject(selectedDb);
}
+ this.store.findAll('file-resource').then((data) => {
+ let fileResourceList = [];
+ data.forEach(x => {
+ let localFileResource = {'id': x.get('id'),
+ 'name': x.get('name'),
+ 'path': x.get('path'),
+ 'owner': x.get('owner')
+ };
+ fileResourceList.push(localFileResource);
+ });
+ controller.set('fileResourceList', fileResourceList);
+ });
+
+ this.store.findAll('udf').then((data) => {
+ let allUDFList = [];
+ data.forEach(x => {
+ let localUDF = {'id': x.get('id'),
+ 'name': x.get('name'),
+ 'classname': x.get('classname'),
+ 'fileResource': x.get('fileResource'),
+ 'owner': x.get('owner')
+ };
+ allUDFList.push(localUDF);
+ });
+ controller.set('allUDFList', allUDFList);
+ });
+
+
controller.set('worksheet', model);
controller.set('selectedTablesModels',model.get('selectedTablesModels') || selectedTablesModels );
@@ -319,6 +318,7 @@ export default Ember.Route.extend(UILoggerMixin, {
let jobDetails = self.store.peekRecord('job', data.job.id);
console.log(jobDetails);
self.send('getJobResult', data, payload.title, jobDetails);
+ self.get('logger').success('Query has been submitted.');
self.transitionTo('queries.query.loading');
}, (error) => {
@@ -387,23 +387,16 @@ export default Ember.Route.extend(UILoggerMixin, {
}, function(error) {
console.log('error' , error);
+ self.get('logger').danger('Failed to execute query.', self.extractError(error));
});
},
showVisualExplain(payloadTitle){
- let self = this;
- let jobId = this.get('controller').get('currentJobId');
- this.get('query').getVisualExplainJson(jobId).then(function(data) {
- console.log('Successful getVisualExplainJson', data);
- self.get('controller.model').set('visualExplainJson', data.rows[0][0]);
-
- if( self.paramsFor('queries.query').worksheetId == payloadTitle){
- self.transitionTo('queries.query.visual-explain');
- }
-
- }, function(error){
- console.log('error getVisualExplainJson', error);
- });
+ if( this.paramsFor('queries.query').worksheetId == payloadTitle){
+ Ember.run.later(() => {
+ this.transitionTo('queries.query.visual-explain');
+ }, 1);
+ }
},
goNextPage(payloadTitle){
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/visual-explain.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/visual-explain.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/visual-explain.js
index ff3832d..c85db19 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/visual-explain.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/visual-explain.js
@@ -32,17 +32,16 @@ export default Ember.Route.extend({
setupController(controller, model){
this._super(...arguments);
-
model.set('lastResultRoute', ".visual-explain");
- if(!Ember.isEmpty(model.get('currentJobData'))){
-
+ if(!Ember.isEmpty(model.get('currentJobData'))) {
let jobId = model.get('currentJobData').job.id;
this.controller.set('jobId', jobId);
this.controller.set('payloadTitle', model.get('currentJobData').job.title);
this.controller.set('isQueryRunning', model.get('isQueryRunning'));
- this.controller.set('visualExplainJson', model.get('visualExplainJson'));
-
+ if(!Ember.isEmpty(JSON.parse(model.get('queryResult').rows[0][0])['STAGE PLANS'])){
+ this.controller.set('visualExplainJson', model.get('queryResult').rows[0][0]);
+ }
this.controller.set('hasJobAssociated', true);
} else {
this.controller.set('hasJobAssociated', false);
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
index 273cd90..fe1b596 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
@@ -28,6 +28,7 @@ export default Ember.Service.extend({
},
waitForJobToComplete(jobId, after, fetchDummyResult = true) {
+
return new Ember.RSVP.Promise((resolve, reject) => {
Ember.run.later(() => {
this.get('store').findRecord('job', jobId, {reload: true})
@@ -41,7 +42,7 @@ export default Ember.Service.extend({
} else if (status === 'error') {
reject(status)
} else {
- resolve(this.waitForJobToComplete(jobId, after));
+ resolve(this.waitForJobToComplete(jobId, after, fetchDummyResult));
}
}, (error) => {
reject(error);
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/log.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/log.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/log.hbs
index c7e30f2..e9f1a50 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/log.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/log.hbs
@@ -17,13 +17,13 @@
}}
{{#unless hasJobAssociated}}
- <div>No Log available.</div>
+ <div class="explain--error">
+ <div>No Log available.</div>
+ </div>
{{/unless}}
{{#if hasJobAssociated}}
<div>
<pre class="prettyprint">{{logResults}}</pre>
</div>
-
-{{/if}}
-
+{{/if}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/results.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/results.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/results.hbs
index d859b04..ad44c5a 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/results.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/results.hbs
@@ -19,7 +19,9 @@
{{outlet}}
{{#unless hasJobAssociated}}
- <div>No Results available.</div>
+ <div class="explain--error">
+ <div>No Results available.</div>
+ </div>
{{/unless}}
{{#if hasJobAssociated}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/tez-ui.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/tez-ui.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/tez-ui.hbs
index 9bf2b2a..edc1e8e 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/tez-ui.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/tez-ui.hbs
@@ -19,5 +19,7 @@
{{#if model.tezUrl}}
<iframe class="tez-ui" src={{model.tezUrl}}></iframe>
{{else}}
-<div>Tez UI not available.</div>
+<div class="explain--error">
+ <div>Tez UI not available.</div>
+</div>
{{/if}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/d797d99f/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/visual-explain.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/visual-explain.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/visual-explain.hbs
index 5b7e566..426f769 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/visual-explain.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/queries/query/visual-explain.hbs
@@ -19,10 +19,17 @@
{{outlet}}
{{#unless hasJobAssociated}}
- <div>No Visual Explain available.</div>
+ <div class="explain--error">
+ <div>No Visual Explain available.</div>
+ </div>
{{/unless}}
{{#if hasJobAssociated}}
+ {{#unless visualExplainJson}}
+ <div class="explain--error">
+ <div>No Visual Explain available.</div>
+ </div>
+ {{/unless}}
{{#if visualExplainJson}}
{{visual-explain
expandQueryResultPanel='expandQueryResultPanel'