Hive - Can one extract common options for reuse in other scripts?

后端 未结 2 1849
长发绾君心
长发绾君心 2021-01-06 17:07

I have two Hive scripts which look like this:

Script A:

SET hive.exec.dynamic.partition=true;
SET hive.exec.dynamic.partition.mode=non-s         


        
相关标签:
2条回答
  • 2021-01-06 17:07

    You can store these configuration parameters in common file and load in each of your scripts using source command:

    source /tmp/common_init.hql;
    

    Also you can generate this file for each workflow from the database.

    0 讨论(0)
  • 2021-01-06 17:23

    You should be able to use hive -i config.hql -f script_A.hql, where config.hql would contain your dynamic settings. The -i flag allows you to pass an initialization script that will be executed before the actual hive file passed to -f. I'm not super familiar with how AWS kicks off hive jobs in steps, but presumably you edit the submission arguments.

    0 讨论(0)
提交回复
热议问题