ilooner closed pull request #1476: DRILL-5782: Web UI: do not attempt to build
visualized plan when plan…
URL: https://github.com/apache/drill/pull/1476
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/exec/java-exec/src/main/resources/rest/static/js/graph.js
b/exec/java-exec/src/main/resources/rest/static/js/graph.js
index 9ea117cc1c5..5801245c660 100644
--- a/exec/java-exec/src/main/resources/rest/static/js/graph.js
+++ b/exec/java-exec/src/main/resources/rest/static/js/graph.js
@@ -19,10 +19,12 @@ $(window).on('load',(function () {
return $.map(table, function (record, index) {
var ra = [];
var nested = faccess(record);
- for (var i = 0; i < nested.length; i++) {
- var newrec = $.extend({}, record);
- newrec[dest] = nested[i];
- ra.push(newrec);
+ if (nested !== undefined) {
+ for (var i = 0; i < nested.length; i++) {
+ var newrec = $.extend({}, record);
+ newrec[dest] = nested[i];
+ ra.push(newrec);
+ }
}
return ra;
});
@@ -350,9 +352,10 @@ $(window).on('load',(function () {
function setupglobalconfig (profile) {
globalconfig.profile = profile;
- globalconfig.majorcolorscale = d3.scale.category20()
- .domain([0, d3.max(profile.fragmentProfile,
accessor("majorFragmentId"))]);
-
+ if (profile.fragmentProfile !== undefined) {
+ globalconfig.majorcolorscale = d3.scale.category20()
+ .domain([0, d3.max(profile.fragmentProfile,
accessor("majorFragmentId"))]);
+ }
}
String.prototype.endsWith = function(suffix) {
@@ -368,7 +371,7 @@ $(window).on('load',(function () {
// trigger svg drawing when visible
$('#query-tabs').on('shown.bs.tab', function (e) {
- if (queryvisualdrawn || !e.target.href.endsWith("#query-visual"))
return;
+ if (profile.plan === undefined || queryvisualdrawn ||
!e.target.href.endsWith("#query-visual")) return;
buildplangraph(d3.select("#query-visual-canvas"), profile.plan);
queryvisualdrawn = true;
})
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services