Re: Variable resolution Fails

2013-05-01 Thread sumit ghosh
Thanks for the solution & the tip. :) From: Sanjay Subramanian To: "user@hive.apache.org" ; sumit ghosh Sent: Tuesday, 30 April 2013 7:44 PM Subject: Re: Variable resolution Fails +1  agreed Also as a general script programming practice

Re: Variable resolution Fails

2013-05-01 Thread Ted Yu
I check if the variables I am >> going to use are NON empty before using them…nothing related to Hive scripts >> >> If [ ${freq} == "" ] >> then >>echo "variable freq is empty…exiting" >>exit 1 >> Fi >> >> >> >> From:

Re: Variable resolution Fails

2013-05-01 Thread Nitin Pawar
hem…nothing related to Hive >> scripts >> >> If [ ${freq} == "" ] >> then >> echo "variable freq is empty…exiting" >>exit 1 >> Fi >> >> >> >> From: Anthony Urso >> Reply-To: "user@hive.apache.o

Re: Variable resolution Fails

2013-05-01 Thread Naidu MS
day, April 30, 2013 7:20 PM > To: "user@hive.apache.org" , sumit ghosh < > sumi...@yahoo.com> > Subject: Re: Variable resolution Fails > > Your shell is expanding the variable ${env:freq}, which doesn't exist > in the shell's environment, so hive is gett

Re: Variable resolution Fails

2013-04-30 Thread Sanjay Subramanian
antho...@cs.ucla.edu>> Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" mailto:user@hive.apache.org>> Date: Tuesday, April 30, 2013 7:20 PM To: "user@hive.apache.org<mailto:user@hive.apache.org>" mailto:user@hive.apache.org>>, sumit gh

Re: Variable resolution Fails

2013-04-30 Thread Anthony Urso
Your shell is expanding the variable ${env:freq}, which doesn't exist in the shell's environment, so hive is getting the empty string in that place. If you are always intending to run your query like this, just use ${freq} which will be expanded as expected by bash and then passed to hive. Cheers

Variable resolution Fails

2013-04-30 Thread sumit ghosh
Hi,   The following variable freq fails to resolve:   bash-4.1$ export freq=MNTH bash-4.1$ echo $freq MNTH bash-4.1$ hive -e "select ${env:freq} as dr  from dual" Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties Hive history file=/hadoop1/hive_querylog/sum