Browse Source

HUE-7327 [impala] CTAS does not trigger an assist refresh

Because it has a resultset with the number of rows inserted.
Romain Rigaux 8 years ago
parent
commit
ddf8623

+ 1 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -166,7 +166,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, get_ord
   </script>
 
   <script type="text/html" id="hdfs-context-items">
-    <li><a href="javascript:void(0);" data-bind="hueLink: definition.url"><i class="fa fa-fw" data-bind="css: {'fa-folder-open-o': definition.type === 'dir', 'fa-file-text-o': definition.type === 'file'}"></i> ${ _('Open in File Browser') }</a></li>
+    <li><a href="javascript:void(0);" data-bind="hueLink: definition.url"><i class="fa fa-fw" data-bind="css: {'fa-folder-open-o': definition.type === 'dir', 'fa-file-text-o': definition.type === 'file'}"></i> ${ _('Open in Browser') }</a></li>
     <!-- ko if: IS_HUE_4 && definition.type === 'file' -->
     <li><a href="javascript:void(0);" data-bind="click: openInImporter"><!-- ko template: { name: 'app-icon-template', data: { icon: 'importer' } } --><!-- /ko --> ${ _('Open in Importer') }</a></li>
     <!-- /ko -->

+ 10 - 5
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1634,12 +1634,11 @@ var EditorViewModel = (function() {
                   setTimeout(function () { // Delay until we get IMPALA-5555
                     self.fetchResultSize(10, _query_id);
                   }, 2000);
-                } else { // Is DDL
-
+                  self.checkDdlNotification(); // DDL CTAS with Impala
+                } else {
+                  // Is DDL
                   if (self.lastExecutedStatement()) {
-                    if (/CREATE|DROP|ALTER/i.test(self.lastExecutedStatement().firstToken)) {
-                      self.ddlNotification(Math.random());
-                    }
+                    self.checkDdlNotification();
                   } else {
                     self.ddlNotification(Math.random());
                   }
@@ -1682,6 +1681,12 @@ var EditorViewModel = (function() {
       });
     };
 
+    self.checkDdlNotification = function() {
+      if (self.lastExecutedStatement() && /CREATE|DROP|ALTER/i.test(self.lastExecutedStatement().firstToken)) {
+        self.ddlNotification(Math.random());
+      }
+    }
+
     self.isCanceling = ko.observable(false);
 
     self.cancel = function () {