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

Review Request #14019 — Created June 12, 2019 and submitted

yingc
hue
master
HUE-8878
hue
jgauthier, johan, romain, weixia
commit 563c8e022eeabd7494f9d55c1df39b9f2c61e330 (HEAD -> master)
Author: Ying Chen <yingchen@cloudera.com>
Date:   Wed Jun 12 15:00:12 2019 -0700

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

:100644 100644 528e765b45... a711a72626... M    desktop/libs/liboozie/src/liboozie/submission2.py
:100644 100644 f3f6a8a79a... 3fee51fb5d... M    desktop/libs/notebook/src/notebook/connectors/base.py


  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
yingc
romain
  1. 
      
  2. How about aggreating to one

    def get_str(self, is_raw=False)

    to avoid duplication?

  3. 
      
yingc
romain
  1. 
      
  2. if for_oozie_action:
    statement = ...
    else:
    statement = snippet['statement_raw']

    return '\n\n\n'.join(['USE %s;\n\n%s' % (snippet['database'], statement) for snippet in self.get_data()['snippets']])

  3. 
      
yingc
romain
  1. 
      
  2. nit: probably simpler to avoid introducing a new util function by just adding a if:

    if from_oozie_action:
    statement = snippet['statement_raw']
    else:
    statement = Notebook.statement_with_variables(snippet)

    return ...

    1. snippet is from the loop:
        for snippet in self.get_data()['snippets']
  3. 
      
yingc
yingc
Review request changed

Status: Closed (submitted)

Loading...