浏览代码

HUE-3764 [editor] When exporting results to a new table, the new table is not shown

Enrico Berti 9 年之前
父节点
当前提交
b997dd1
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

+ 9 - 2
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -723,7 +723,6 @@
         if (self.database().table() && self.database().table().name == tableDef.name) {
           return;
         }
-
         var setTableAfterLoad = function () {
           var foundTables = $.grep(self.database().tables(), function (table) {
             return table.name === tableDef.name;
@@ -731,13 +730,21 @@
           if (foundTables.length === 1) {
             self.database().setTable(foundTables[0], callback);
           }
+          else {
+            huePubSub.publish('assist.clear.db.cache', {
+              sourceType: 'hive',
+              clearAll: false,
+              databaseName: self.database().name
+            });
+            self.database().load(setTableAfterLoad, self.optimizerEnabled());
+          }
         };
 
         if (!self.database().loaded()) {
           var doOnce = self.database().loaded.subscribe(function () {
             setTableAfterLoad();
             doOnce.dispose();
-          })
+          });
         } else {
           setTableAfterLoad();
         }