You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jonathan Bender <jo...@gmail.com> on 2011/05/04 23:10:19 UTC

HiveQL scripts and input arguments

Hey all,

Just wondering if there is native support for input arguments on Hive
scripts.

eg. $ bin/hive -f script.q <arg1 arg2>

Any documentation I could reference to look into this further?

Cheers,
Jon

Re: HiveQL scripts and input arguments

Posted by Edward Capriolo <ed...@gmail.com>.
Hive 0.7.X and up supports using variables in queries. This is
documented in the SVN tree.

http://svn.apache.org/repos/asf/hive/trunk/docs/xdocs/language_manual/var_substitution.xml

You still might need some scripting outside of hive still but in many
cases this can get the job done.


On Wed, May 4, 2011 at 5:27 PM, Tim Spence <yo...@gmail.com> wrote:
> I'm wondering the same.  I didn't notice it in the documentation for 0.7.
> My (possibly silly) way of dealing with it is to write ruby scripts to
> concatenate commands like
>
>> bin/hive -e "some statement"
>
> to a shell script, then execute the shell script.  Parameterized scripting
> would be so welcome right now.
> Tim
>
>
>
>
> On Wed, May 4, 2011 at 2:10 PM, Jonathan Bender <jo...@gmail.com>
> wrote:
>>
>> Hey all,
>> Just wondering if there is native support for input arguments on Hive
>> scripts.
>> eg. $ bin/hive -f script.q <arg1 arg2>
>> Any documentation I could reference to look into this further?
>> Cheers,
>> Jon
>

Re: HiveQL scripts and input arguments

Posted by Tim Spence <yo...@gmail.com>.
I'm wondering the same.  I didn't notice it in the documentation for 0.7.
My (possibly silly) way of dealing with it is to write ruby scripts to
concatenate commands like

> bin/hive -e "some statement"

to a shell script, then execute the shell script.  Parameterized scripting
would be so welcome right now.
Tim




On Wed, May 4, 2011 at 2:10 PM, Jonathan Bender
<jo...@gmail.com>wrote:

> Hey all,
>
> Just wondering if there is native support for input arguments on Hive
> scripts.
>
> eg. $ bin/hive -f script.q <arg1 arg2>
>
> Any documentation I could reference to look into this further?
>
> Cheers,
> Jon
>

Re: HiveQL scripts and input arguments

Posted by Jonathan Bender <jo...@gmail.com>.
Thanks everybody.

More reader friendly version of that SVN doc:
http://archive.cloudera.com/cdh/3/hive/language_manual/var_substitution.html

On Wed, May 4, 2011 at 3:15 PM, Time Less <ti...@gmail.com> wrote:

>
> Just wondering if there is native support for input arguments on Hive
>> scripts.
>>  eg. $ bin/hive -f script.q <arg1 arg2>
>> Any documentation I could reference to look into this further?
>>
>
> A workaround:
>
> cat script.q | sed -e 's/arg1/arg1val/' | bin/hive
>
> --
> Tim Ellis
> Riot Games
>
>

Re: HiveQL scripts and input arguments

Posted by Time Less <ti...@gmail.com>.
> Just wondering if there is native support for input arguments on Hive
> scripts.
> eg. $ bin/hive -f script.q <arg1 arg2>
> Any documentation I could reference to look into this further?
>

A workaround:

cat script.q | sed -e 's/arg1/arg1val/' | bin/hive

-- 
Tim Ellis
Riot Games