You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Chhaya Vishwakarma <Ch...@lntinfotech.com> on 2014/06/02 09:04:16 UTC

Storing result of a query in a variable

Hi ,

I have a query whose result I wanted to store in a variable
How can I do it ?
I tried

./hive -e  "use telecom;insert overwrite local directory '/tmp/result' select
avg( a from abc;"

./hive --hiveconf MY_VAR =`cat /tmp/result/000000_0`;

I am able to get average value in MY_VAR but it takes me in hive CLI which is not required



________________________________
The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"