hue oozie执行impala sql

hue oozie执行impala sql,第1张

hue oozie执行impala sql

在hue使用oozie即workflow执行impala sql,需要使用shell调用impala-shell

一、如果开启了LDAP,impala-shell需要输入密码,则shell需要调用expect传输密码
shell脚本execute_impala_sql_file.sh如下:

#!/bin/bash
export PYTHON_EGG_CACHE=/home/hive/.python-eggs
expect  execute_impala_sql_file.exp 

execute_impala_sql_file.exp如下:

#!/usr/bin/expect -f 
set filename [lindex $argv 0] 
 spawn impala-shell -i hostname -d default -l -u hive --auth_creds_ok_in_clear -f $filename
 expect {  
 "LDAP password for hive" { send "password" }  
 }  
 expect eof

在workflow配置shell执行即可

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5652798.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存