Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-2774

Hive Action with init script (-i filename) argument is not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Bug
    • 4.2.0, 4.3.0
    • None
    • action
    • None
    • HDP 2.4, Beeline version 1.2.1000.2.4.0.0-169

    Description

      In hive-cli and beeline one can add the path to init scripts via the commandline argument -i. In both tools, this file needs to be available locally (not in HDFS). However, using the <argument>-i init.hive</argument> does not work even if the file was linked to the local appcache directory via the <file> property.

      Here is a minimal example (full workflow is available on Github https://github.com/chaosmail/oozie-bugs/tree/master/simple-hive-init/simple-hive-init-wf)

      <action name="test-action">
      <hive2 xmlns="uri:oozie:hive2-action:0.1">
        <jdbc-url>${jdbcURL}</jdbc-url>
        <script>query.hive</script>
        <argument>-i init.hive</argument>
        <file>init.hive#init.hive</file>
      </hive2>
      <ok to="end"/>
      <error to="fail"/>
      </action>
      

      In this job beeline fails with an error (can be found in the hive2-oozie-**.log file in the appcache directory).

      more 
      Connecting to jdbc:hive2://localhost:10000/default
      Connected to: Apache Hive (version 1.2.1000.2.4.0.0-169)
      Driver: Hive JDBC (version 1.2.1000.2.4.0.0-169)
      Transaction isolation: TRANSACTION_REPEATABLE_READ
      Running init script  init.hive
        init.hive (No such file or directory)
      

      Please note, that the Oozie job will finish with status succeeded even though beeline throws an error (I submitted this extra here https://issues.apache.org/jira/browse/OOZIE-2772)

      Interestingly, running a shell action and outputting pwd it matches with the appcache/application_1480609892100_0274/container_e55_148060‌​9892100_0274_01_0000‌​01 directory where also the init.hive file is located. It seems that the beeline client might not be started in the same local container directory - otherwise it should find the init.hive file.

      Attachments

        Activity

          People

            Unassigned Unassigned
            office@chaosmail.at Christoph Körner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: