|
@@ -372,6 +372,7 @@
|
|
|
this.delayedStatement = ko.pureComputed(self.statement).extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 2000 } });
|
|
this.delayedStatement = ko.pureComputed(self.statement).extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 2000 } });
|
|
|
this.delayedStatement.subscribe(function (val) {
|
|
this.delayedStatement.subscribe(function (val) {
|
|
|
self.getComplexity();
|
|
self.getComplexity();
|
|
|
|
|
+ self.hasSuggestion(false);
|
|
|
}, this);
|
|
}, this);
|
|
|
|
|
|
|
|
self.result = new Result(snippet, snippet.result);
|
|
self.result = new Result(snippet, snippet.result);
|
|
@@ -432,6 +433,9 @@
|
|
|
return self.complexity().length > 0;
|
|
return self.complexity().length > 0;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ self.suggestion = ko.observable(typeof snippet.complexity != "undefined" && snippet.complexity != null ? snippet.complexity : '');
|
|
|
|
|
+ self.hasSuggestion = ko.observable(false);
|
|
|
|
|
+
|
|
|
self.chartType = ko.observable(typeof snippet.chartType != "undefined" && snippet.chartType != null ? snippet.chartType : ko.HUE_CHARTS.TYPES.BARCHART);
|
|
self.chartType = ko.observable(typeof snippet.chartType != "undefined" && snippet.chartType != null ? snippet.chartType : ko.HUE_CHARTS.TYPES.BARCHART);
|
|
|
self.chartSorting = ko.observable(typeof snippet.chartSorting != "undefined" && snippet.chartSorting != null ? snippet.chartSorting : "none");
|
|
self.chartSorting = ko.observable(typeof snippet.chartSorting != "undefined" && snippet.chartSorting != null ? snippet.chartSorting : "none");
|
|
|
self.chartScatterGroup = ko.observable(typeof snippet.chartScatterGroup != "undefined" && snippet.chartScatterGroup != null ? snippet.chartScatterGroup : null);
|
|
self.chartScatterGroup = ko.observable(typeof snippet.chartScatterGroup != "undefined" && snippet.chartScatterGroup != null ? snippet.chartScatterGroup : null);
|
|
@@ -664,13 +668,17 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.queryCompatibility = function () {
|
|
self.queryCompatibility = function () {
|
|
|
|
|
+ logGA('compatibility');
|
|
|
|
|
+ self.suggestion(false);
|
|
|
|
|
+
|
|
|
$.post("/metadata/api/optimizer_api/query_compatibility", {
|
|
$.post("/metadata/api/optimizer_api/query_compatibility", {
|
|
|
query: self.statement(),
|
|
query: self.statement(),
|
|
|
sourcePlatform: self.type(),
|
|
sourcePlatform: self.type(),
|
|
|
targetPlatform: 'impala'
|
|
targetPlatform: 'impala'
|
|
|
}, function(data) {
|
|
}, function(data) {
|
|
|
if (data.status == 0) {
|
|
if (data.status == 0) {
|
|
|
- $(document).trigger("info", data.query_compatibility);
|
|
|
|
|
|
|
+ self.suggestion(ko.mapping.fromJS(data.query_compatibility.platformCompilationStatus.Impala));
|
|
|
|
|
+ self.hasSuggestion(true);
|
|
|
} else {
|
|
} else {
|
|
|
$(document).trigger("error", data.message);
|
|
$(document).trigger("error", data.message);
|
|
|
}
|
|
}
|