(原創)
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寫。