1. hive command 라인 수행

    ADD JAR /tmp/HiveSwarm-1.0-SNAPSHOT.jar;

    create temporary function dayofweek as 'com.livingsocial.hive.udf.DayOfWeek';

    select *, dayofweek(to_date('2014-05-02')) from test_table

    where age>${age} order by name;


    hive -hivevar age=50 -f hive.sql



2. oozie job으로 변경

   jar 파일은 workflow root 디렉토리 밑에 /lib으로 복사후 삭제


  <action name="myHiveAction">

  <hive>  

       <job-tracker>nn1:8032</job-tracker>

       <name-node>hdfs://nn:8020</name-node>

       <job-xml>hive-config.xml</job-xml>

       <script>hive.hql</script>

       <argument>-hivevar</argument>

       <argument>age=50</argument>

  </hive>

  <ok to="success"/>

  <error to="fail"/>

  </action>



'NoSQL > oozie' 카테고리의 다른 글

oozie bundle  (0) 2017.03.03
oozie current() versus latest() comparison  (0) 2017.03.03
oozie decision  (0) 2017.03.02
oozie python map/reduce job  (0) 2017.03.02
oozie workflow and coordinator  (0) 2017.03.02

+ Recent posts