oozie运行hive以及hive的udf


一,
执行hiveAction除了需要配置oozie.hive.defaults外,还需要配置几个hive的参数。
这点我不是很理解,以为只要在hive-site.xml里面配置了,就完事了,结果不行,还需要单独配置,而且oozie.hive.defaults不配置还不行。
配置如下:
<property>
    <name>oozie.hive.defaults</name>
    <value>my-hive-default.xml</value>
</property>

<property>
  <name>hive.metastore.local</name>
  <value>false</value>
  <description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description>
</property>

<property>
  <name>hive.metastore.uris</name>
  <value>thrift://xx.xx.xx.xx:9083</value>
  <description>host and port for the thrift metastore server</description>
</property>

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/hive/warehouse0</value>
  <description>location of default database for the warehouse</description>
</property>




二,
执行hive的udf时,不需要在hive脚本里面写add /xxx/xxx/xxx/HIVE_UDF.jar.
只要保证这个HIVE_UDF.jar在sharelib里面,或者file指定应该也行(这个没试,猜的)。
那个create temporary function xxxxx as 'yyy';还是要在脚本里面写的。

猜你喜欢

转载自taoo.iteye.com/blog/1559425