Browse Source

[ui] Improve yarn config check for skipping job names in log div (#2853)

- Previous logic failed for other job names if config is not present, now we only skip yarn jobs which start with 'application' if the config is not present. This will allow Impala job browser links to be shown in the log div.
Harsh Gupta 3 years ago
parent
commit
4d00fdc845
1 changed files with 7 additions and 2 deletions
  1. 7 2
      desktop/core/src/desktop/js/apps/notebook/snippet.js

+ 7 - 2
desktop/core/src/desktop/js/apps/notebook/snippet.js

@@ -2576,9 +2576,14 @@ class Snippet {
                     job.percentJob = ko.observable(job.percentJob);
                     job.percentJob = ko.observable(job.percentJob);
                   }
                   }
                   const config = getLastKnownConfig();
                   const config = getLastKnownConfig();
-                  if (config && config['hue_config'] && config['hue_config']['is_yarn_enabled']) {
-                    self.jobs.push(job);
+                  // Yarn job names start with 'application' and we skip them if yarn config is not present.
+                  if (
+                    job.name.startsWith('application') &&
+                    !(config && config['hue_config'] && config['hue_config']['is_yarn_enabled'])
+                  ) {
+                    return;
                   }
                   }
+                  self.jobs.push(job);
                 } else if (typeof job.percentJob !== 'undefined') {
                 } else if (typeof job.percentJob !== 'undefined') {
                   for (let i = 0; i < _found.length; i++) {
                   for (let i = 0; i < _found.length; i++) {
                     _found[i].percentJob(job.percentJob);
                     _found[i].percentJob(job.percentJob);