Преглед изворни кода

HUE-8878 [oozie] Fix Hive Document Action variable with prefilled value

Ying Chen пре 6 година
родитељ
комит
52d99e281c

+ 1 - 1
desktop/libs/liboozie/src/liboozie/submission2.py

@@ -327,7 +327,7 @@ impala-shell %(kerberos_option)s %(ssl_option)s -i %(impalad_host)s -f %(query_f
           from notebook.models import Notebook
           if action.data['properties'].get('uuid'):
             notebook = Notebook(document=Document2.objects.get_by_uuid(user=self.user, uuid=action.data['properties']['uuid']))
-            statements = notebook.get_str()
+            statements = notebook.get_str(from_oozie_action=True)
           else:
             statements = action.data['properties'].get('statements')
 

+ 3 - 2
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -103,8 +103,9 @@ class Notebook(object):
 
     return _data
 
-  def get_str(self):
-    return '\n\n\n'.join(['USE %s;\n\n%s' % (snippet['database'], Notebook.statement_with_variables(snippet)) for snippet in self.get_data()['snippets']])
+  def get_str(self, from_oozie_action=False):
+    return '\n\n\n'.join(['USE %s;\n\n%s' % (snippet['database'], snippet['statement_raw'] if from_oozie_action else Notebook.statement_with_variables(snippet))
+                          for snippet in self.get_data()['snippets']])
 
   @staticmethod
   def statement_with_variables(snippet):