Created on 03-14-2022 09:14 PM - edited on 05-27-2024 04:17 AM by smruti
Perform the following steps to access the Hive MetaStore database :-
e.g.
[root@xxxx-master0 ~]# source activate_salt_env (salt_3001.8) [root@xxxx-master0 ~]# export PGPASSWORD=$(salt-call pillar.get postgres:hive:password 2>/dev/null| tail -n 1 | awk '{print $1}') (salt_3001.8) [root@xxxx-master0 ~]# HIVE_DB=$(salt-call pillar.get postgres:hive:database 2>/dev/null| tail -n 1 | awk '{print $1}') (salt_3001.8) [root@xxxx-master0 ~]# HIVE_DB_USER=$(salt-call pillar.get postgres:hive:user 2>/dev/null| tail -n 1 | awk '{print $1}') (salt_3001.8) [root@xxxx-master0 ~]# psql -U ${HIVE_DB_USER} -d ${HIVE_DB} -c "SELECT version();" version ---------------------------------------------------------------------------------------------------------- PostgreSQL 14.11 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit (1 row)