hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avram Aelony <AvramAel...@eharmony.com>
Subject Re: Dynamic Configuration support in Hive SQL
Date Mon, 21 Mar 2011 23:28:11 GMT

You can probably do this in Bash now, try something like this:

zz=`hive -S -e "select count(1) from t"`


~Avram


~ Avram Aelony|Sr. Analyst|eHarmony.com|(424) 258-1199|x1098|skype: avram.aelony ~

On Mar 21, 2011, at 3:55 PM, Sameer Kalburgi wrote:

> Any plans, if possible, to allow you to set the variable from a query result e.g. 'set
zzz = (select count(1) from t)'?
> 
> On Mon, Mar 21, 2011 at 5:20 PM, Edward Capriolo <edlinuxguru@gmail.com> wrote:
> On Mon, Mar 21, 2011 at 11:43 AM, Andrew  Wilson <awilson@conductor.com> wrote:
> > We use the Cloudera Oozie distro which has a Hive action, and provides that kind
of template support for Hive scripts.
> >
> > On Mar 21, 2011, at 11:35 AM, Lenin Gali wrote:
> >
> >> Best way to do this is to write shell or python scripts and echo with substitute
variables and call hive from command line passing -f argument with output file.
> >>
> >> Lenin
> >> Sent from my BlackBerry® wireless handheld
> >>
> >> -----Original Message-----
> >> From: amit jaiswal <amit_jus@yahoo.com>
> >> Date: Mon, 21 Mar 2011 08:10:55
> >> To: <user@hive.apache.org>
> >> Reply-To: user@hive.apache.org
> >> Subject: Dynamic Configuration support in Hive SQL
> >>
> >> Hi,
> >>
> >> Does hive support dynamic configuration? For example: is it possible to write
a
> >> hive script with some ${PARAM} variables and let hive replace these parameters
> >> with their values at runtime.
> >>
> >> Eg.
> >> Original hive script:
> >> select * from person where age > ${MIN_AGE};
> >>
> >> Config file:
> >> MIN_AGE=18
> >>
> >> And hive replaces the MIN_AGE parameter automatically.
> >>
> >> -amit
> >>
> >
> >
> 
> Hive 0.7.0 will support variables substitution.
> This is the xdoc
> http://svn.apache.org/repos/asf/hive/trunk/docs/xdocs/language_manual/var_substitution.xml
> (you can built the doc into nicer html by running ant docs in trunk)
> 


Mime
View raw message