hive调用python脚本

(原创)

hive可以调用python的脚本,方法是:

add file  /path_of_python_file/py_file.py; 

select transform(col1,col2,col3...) using 'python py_file.py' as (out1,out2,out3...) from table;

transform 的参数col1,col2,col3... 作为python脚本的输入,而out1,out2,out3...作为输出字段。

利用这个可以把hive自身所带的函数不能或不方便处理的任务,转用python写。

原文地址:https://www.cnblogs.com/randomstring/p/10438237.html