瀏覽代碼

HUE-9207 [frontend] Check complexity for all dialects when configured in editor V2

Johan Ahlen 5 年之前
父節點
當前提交
a73055cbd7
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      desktop/core/src/desktop/js/apps/notebook2/snippet.js

+ 9 - 9
desktop/core/src/desktop/js/apps/notebook2/snippet.js

@@ -823,7 +823,8 @@ export default class Snippet {
       }
     });
 
-    if (HAS_OPTIMIZER && !this.parentVm.isNotificationManager()) {
+    // TODO: Add optimizer check per connector?
+    if (window.HAS_OPTIMIZER && !this.parentVm.isNotificationManager()) {
       let lastComplexityRequest;
       let lastCheckedComplexityStatement;
       const knownResponses = [];
@@ -933,16 +934,15 @@ export default class Snippet {
         }
       };
 
-      if (this.dialect() === DIALECT.hive || this.dialect() === DIALECT.impala) {
-        if (this.statement_raw()) {
-          window.setTimeout(() => {
-            this.checkComplexity();
-          }, 2000);
-        }
-        this.delayedStatement.subscribe(() => {
+      if (this.statement_raw()) {
+        window.setTimeout(() => {
           this.checkComplexity();
-        });
+        }, 2000);
       }
+
+      this.delayedStatement.subscribe(() => {
+        this.checkComplexity();
+      });
     }
 
     this.wasBatchExecuted = ko.observable(!!snippetRaw.wasBatchExecuted);