Browse Source

HUE-8397 [importer] Fix failure to import parquet table.

jdesjean 7 years ago
parent
commit
126ce014b0

+ 2 - 2
desktop/libs/indexer/src/indexer/indexers/sql.py

@@ -201,10 +201,10 @@ class SQLIndexer(object):
 
 
     editor_type = 'impala' if table_format == 'kudu' else destination['sourceType']
     editor_type = 'impala' if table_format == 'kudu' else destination['sourceType']
 
 
-    on_success_url = reverse('metastore:describe_table', kwargs={'database': database, 'table': table_name})
+    on_success_url = reverse('metastore:describe_table', kwargs={'database': database, 'table': final_table_name})
 
 
     return make_notebook(
     return make_notebook(
-        name=_('Creating table %(database)s.%(table)s') % {'database': database, 'table': table_name},
+        name=_('Creating table %(database)s.%(table)s') % {'database': database, 'table': final_table_name},
         editor_type=editor_type,
         editor_type=editor_type,
         statement=sql.strip(),
         statement=sql.strip(),
         status='ready',
         status='ready',

+ 3 - 3
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1525,9 +1525,9 @@ var EditorViewModel = (function() {
       self.showLongOperationWarning(false);
       self.showLongOperationWarning(false);
     }
     }
 
 
-    self.execute = function () {
+    self.execute = function (automaticallyTriggered) {
       var now = (new Date()).getTime(); // We don't allow fast clicks
       var now = (new Date()).getTime(); // We don't allow fast clicks
-      if (self.status() == 'running' || self.status() == 'loading') {
+      if (!automaticallyTriggered && (self.status() == 'running' || self.status() == 'loading')) { // Do not cancel statements that are parts of a set of steps to execute (e.g. import). Only cancel statements as requested by user
         self.cancel();
         self.cancel();
       } else if (now - self.lastExecuted() < 1000 || ! self.isReady()) {
       } else if (now - self.lastExecuted() < 1000 || ! self.isReady()) {
         return;
         return;
@@ -2007,7 +2007,7 @@ var EditorViewModel = (function() {
 
 
                   if (self.result.handle().has_more_statements) {
                   if (self.result.handle().has_more_statements) {
                     setTimeout(function () {
                     setTimeout(function () {
-                      self.execute(); // Execute next, need to wait as we disabled fast click
+                      self.execute(true); // Execute next, need to wait as we disabled fast click
                     }, 1000);
                     }, 1000);
                   }
                   }
                 }
                 }