Support Questions
Find answers, ask questions, and share your expertise

Hive Beeline parameters in shell script

Hive Beeline parameters in shell script

Explorer

Hello everybody,

I want to use beeline in Shell script and it not working properly . can someone help me to resolve this .

main_script.sh

source /file_path/configs.sh -- with 777 permission

beeline -u ${hive_connection_string} -n $USER_NAME -p $PASSWORD -f /usr/hql/query.hql

configs.sh

current_dir="/data/landing/"

hive_connection_string='jdbc:hive2://host1:2181,host2:2181,host3:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;#currentdir='${current_dir}

query.hql

create external table ( ....) location /user/hdfs_path/landingdir/ --> this directory is also not picking in the main script .

What is the main thing am I missing or how can I achieve this .

When we try to run the main_script.sh the values

-n $USER_NAME/password is not picking in the main script . What am I doing wrong . I think it is taking me to beeline session . so the shell is not taking the right .

Have tried this step alone for many hours , tried all the possibilites of single quotes , double quotes , flower braces without braces. It didn't seem to work . what is right way to approach this