Просмотр исходного кода

HUE-8747 [editor] Support oozie jobs for tasks.

jdesjean 6 лет назад
Родитель
Сommit
d34e0d9e50

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -556,7 +556,7 @@ class ResultWrapper():
 
   def fetch(self, start_over=None, rows=None):
     if start_over:
-      if not self.snippet['result']['handle'] or not self.snippet['result']['handle'].get('guid') or not self.api.can_start_over(self.notebook, self.snippet):
+      if not self.snippet['result'].get('handle') or not self.snippet['result']['handle'].get('guid') or not self.api.can_start_over(self.notebook, self.snippet):
         start_over = False
         handle = self.api.execute(self.notebook, self.snippet)
         self.snippet['result']['handle'] = handle

+ 4 - 1
desktop/libs/notebook/src/notebook/sql_utils.py

@@ -43,6 +43,9 @@ def get_statements(hql_query):
 
 def get_current_statement(snippet):
   # Multiquery, if not first statement or arrived to the last query
+  should_close = False
+  if not snippet['result'].get('handle'):
+    return should_close, {}
   statement_id = snippet['result']['handle'].get('statement_id', 0)
   statements_count = snippet['result']['handle'].get('statements_count', 1)
 
@@ -51,7 +54,7 @@ def get_current_statement(snippet):
   statement_id = min(statement_id, len(statements) - 1) # In case of removal of statements
   previous_statement_hash = compute_statement_hash(statements[statement_id]['statement'])
   non_edited_statement = previous_statement_hash == snippet['result']['handle'].get('previous_statement_hash') or not snippet['result']['handle'].get('previous_statement_hash')
-  should_close = False
+
   if snippet['result']['handle'].get('has_more_statements'):
     should_close = True
     if non_edited_statement: