Skip to main content

Home

Tagging a Hive on Tez query

For general information see Tagging Workflows.

The following properties must be set in /usr/local/unravel/etc/unravel.properties. You should adjust the script path and method name parameters according to your cluster setup.

com.unraveldata.tagging.script.enabled=true
com.unraveldata.app.tagging.script.path=/usr/local/unravel/etc/tag_app.py
com.unraveldata.app.tagging.script.method.name=get_tags
You can create tagged workflows for Tez apps in four ways.
  1. Use --hiveconf via hive command.

    Enter the following the hive command line.

    hive --hiveconf unravel.workflow.name=my_tez_workflow --hiveconf unravel.workflow.utctimestamp=20180801T000001Z -f tez.sql
    

    Sample tez.sql.

    set hive.execution.engine=tez;
    select count(*) from my_test_table; 
  2. Use the global Python script for app tagging.

    Assuming the global script is /tmp/tag_app.py, you would add the two workflow tags to the object returned from the main method.

  3. Use --hiveconf via beeline command.

    Enter the following command in the Beeline command line.

    > beeline -n hive -u 'jdbc:hive2://host2.unraveldata.com:10000' --hiveconf unravel.workflow.name=my_tez_workflow --hiveconf unravel.workflow.utctimestamp=20180801T000001Z -f tez.sql
    
  4. Use the tez.sql script, then run Beeline.

    You must define these the two workflow tags in tez.sql:

    set hive.execution.engine=tez;
    set unravel.workflow.name=my_tez_workflow;
    set unravel.workflow.utctimestamp=20180801T000001Z;
    select count(*) from my_test_table;

    Enter the following command in the beeline command line.

    > beeline -n hive -u 'jdbc:hive2://host2.congo6.unraveldata.com:10000'-f tez.sql