ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From niti...@apache.org
Subject ambari git commit: AMBARI-17727. removed comment of --Global Settings-- from query and corrected addition of semi colon at end (nitirajrathore)
Date Tue, 19 Jul 2016 12:21:17 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 0ad6daff6 -> 03e996329


AMBARI-17727. removed comment of --Global Settings-- from query and corrected addition of
semi colon at end (nitirajrathore)


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

Branch: refs/heads/trunk
Commit: 03e9963296dbeaaacc3d71cc70beb99ca9ba7964
Parents: 0ad6daf
Author: Nitiraj Rathore <nitiraj.rathore@gmail.com>
Authored: Tue Jul 19 17:49:45 2016 +0530
Committer: Nitiraj Rathore <nitiraj.rathore@gmail.com>
Committed: Tue Jul 19 17:49:45 2016 +0530

----------------------------------------------------------------------
 .../ui/hive-web/app/controllers/index.js        | 26 ++++----------------
 .../ui/hive-web/app/services/settings.js        |  2 --
 .../ui/hive-web/app/utils/constants.js          |  4 ---
 .../ui/hive-web/app/controllers/index.js        | 26 ++++----------------
 .../ui/hive-web/app/services/settings.js        |  2 --
 .../ui/hive-web/app/utils/constants.js          |  4 ---
 6 files changed, 10 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js
index d68d82e..e67aaed 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/index.js
@@ -199,7 +199,6 @@ export default Ember.Controller.extend({
     finalQuery = query;
     finalQuery = this.bindQueryParams(finalQuery);
     finalQuery = this.prependGlobalSettings(finalQuery, job);
-    finalQuery = this.rearrangeComponents(finalQuery);
     job.set('forcedContent', finalQuery);
 
     if (shouldGetVisualExplain) {
@@ -209,25 +208,6 @@ export default Ember.Controller.extend({
     return this.createJob(job, originalModel);
   },
 
-  /**
-   * Rearranges the files and udfs statements to the starting of the query.
-   */
-  rearrangeComponents: function(query) {
-    var extractedComponents = this.extractComponents(query);
-    var modifiedFinalQuery = '';
-    if (extractedComponents.files.length) {
-      modifiedFinalQuery += extractedComponents.files.join("\n") + "\n\n";
-    }
-
-    if (extractedComponents.udfs.length) {
-      modifiedFinalQuery += extractedComponents.udfs.join("\n") + "\n\n";
-    }
-    var newQueries = extractedComponents.queryString.split(";");
-    newQueries = newQueries.filter(Boolean);
-    modifiedFinalQuery += newQueries.join(";") + ";";
-    return modifiedFinalQuery;
-  },
-
   getVisualExplainJson: function (job, originalModel) {
     var self = this;
     var defer = Ember.RSVP.defer();
@@ -347,7 +327,11 @@ export default Ember.Controller.extend({
       finalQuery += queryComponents.udfs.join("\n") + "\n\n";
     }
 
-    finalQuery += queries.join(";") + ";";
+    finalQuery += queries.join(";");
+    if(!finalQuery.trim().endsWith(';')){
+      finalQuery = finalQuery.trim() + ";";
+    }
+
     return finalQuery.trim();
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/contrib/views/hive-next/src/main/resources/ui/hive-web/app/services/settings.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/services/settings.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/services/settings.js
index df135d3..cae3076 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/services/settings.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/services/settings.js
@@ -172,8 +172,6 @@ export default Ember.Service.extend({
       asString += "set %@=%@;\n".fmt(setting.get('key.name'), setting.get('value'));
     });
 
-    asString += constants.globalSettings.comment;
-
     return asString;
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
index bbe42cf..eb1548e 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
@@ -224,10 +224,6 @@ export default Ember.Object.create({
     }
   },
 
-  globalSettings: {
-    comment: "--Global Settings--\n\n"
-  },
-
   defaultVisualizationRowCount: 10000
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/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 72f717d..7d5f4ae 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
@@ -200,7 +200,6 @@ export default Ember.Controller.extend({
     finalQuery = query;
     finalQuery = this.bindQueryParams(finalQuery);
     finalQuery = this.prependGlobalSettings(finalQuery, job);
-    finalQuery = this.rearrangeComponents(finalQuery);
     job.set('forcedContent', finalQuery);
 
     if (shouldGetVisualExplain) {
@@ -210,25 +209,6 @@ export default Ember.Controller.extend({
     return this.createJob(job, originalModel);
   },
 
-  /**
-   * Rearranges the files and udfs statements to the starting of the query.
-   */
-  rearrangeComponents: function(query) {
-    var extractedComponents = this.extractComponents(query);
-    var modifiedFinalQuery = '';
-    if (extractedComponents.files.length) {
-      modifiedFinalQuery += extractedComponents.files.join("\n") + "\n\n";
-    }
-
-    if (extractedComponents.udfs.length) {
-      modifiedFinalQuery += extractedComponents.udfs.join("\n") + "\n\n";
-    }
-    var newQueries = extractedComponents.queryString.split(";");
-    newQueries = newQueries.filter(Boolean);
-    modifiedFinalQuery += newQueries.join(";") + ";";
-    return modifiedFinalQuery;
-  },
-
   getVisualExplainJson: function (job, originalModel) {
     var self = this;
     var defer = Ember.RSVP.defer();
@@ -338,7 +318,11 @@ export default Ember.Controller.extend({
       finalQuery += queryComponents.udfs.join("\n") + "\n\n";
     }
 
-    finalQuery += queries.join(";") + ";";
+    finalQuery += queries.join(";");
+    if(!finalQuery.trim().endsWith(';')){
+      finalQuery = finalQuery.trim() + ";";
+    }
+
     return finalQuery.trim();
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/contrib/views/hive/src/main/resources/ui/hive-web/app/services/settings.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/services/settings.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/services/settings.js
index df135d3..cae3076 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/services/settings.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/services/settings.js
@@ -172,8 +172,6 @@ export default Ember.Service.extend({
       asString += "set %@=%@;\n".fmt(setting.get('key.name'), setting.get('value'));
     });
 
-    asString += constants.globalSettings.comment;
-
     return asString;
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/03e99632/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js
index cf87c9d..95aeb6d 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js
@@ -225,10 +225,6 @@ export default Ember.Object.create({
     }
   },
 
-  globalSettings: {
-    comment: "--Global Settings--\n\n"
-  },
-
   defaultVisualizationRowCount: 10000
 
 });


Mime
View raw message