You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "Bogala, Chandra Reddy" <Ch...@gs.com> on 2014/06/20 11:14:26 UTC

hive variables

How does hive variables work?. if I have multiple Hive jobs running simultaneously? Will they end up picking up values from each other?
In automation I am constructing an HQL file by prepending it with some SET statements. I want to make sure if I submit two jobs at the same time that use the same variable names, one job won't pick up values from the other job.

Same question from stakeoverflow: http://stackoverflow.com/questions/12464636/how-to-set-variables-in-hive-scripts

Thanks,
Chandra


Re: hive variables

Posted by Nitin Pawar <ni...@gmail.com>.
perfect


On Sun, Jun 22, 2014 at 11:48 AM, Lefty Leverenz <le...@gmail.com>
wrote:

> Thanks Nitin, I've added that information to the wiki on the Variable
> Substitution page
> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+VariableSubstitution#LanguageManualVariableSubstitution-SubstitutionDuringQueryConstruction>
> .
>
> Please check my wording and let me know if revisions are needed.
>
> -- Lefty
>
>
> On Fri, Jun 20, 2014 at 5:17 AM, Nitin Pawar <ni...@gmail.com>
> wrote:
>
>> hive variables are not replaced on mapreduce jobs but when the query is
>> constructed with the variable.
>>
>> if you are running two difference hivesessions, the variables will not be
>> mixed.
>>
>> If you are setting variables with same name in same hive session then the
>> last set value will be picked
>>
>>
>> On Fri, Jun 20, 2014 at 2:44 PM, Bogala, Chandra Reddy <
>> Chandra.Bogala@gs.com> wrote:
>>
>>> How does hive variables work?. if I have multiple Hive jobs running
>>> simultaneously? Will they end up picking up values from each other?
>>>
>>> In automation I am constructing an HQL file by prepending it with some
>>> SET statements. I want to make sure if I submit two jobs at the same time
>>> that use the same variable names, one job won't pick up values from the
>>> other job.
>>>
>>>
>>>
>>> Same question from stakeoverflow:
>>> http://stackoverflow.com/questions/12464636/how-to-set-variables-in-hive-scripts
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Chandra
>>>
>>>
>>>
>>
>>
>>
>> --
>> Nitin Pawar
>>
>
>


-- 
Nitin Pawar

Re: hive variables

Posted by Lefty Leverenz <le...@gmail.com>.
Thanks Nitin, I've added that information to the wiki on the Variable
Substitution page
<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+VariableSubstitution#LanguageManualVariableSubstitution-SubstitutionDuringQueryConstruction>
.

Please check my wording and let me know if revisions are needed.

-- Lefty


On Fri, Jun 20, 2014 at 5:17 AM, Nitin Pawar <ni...@gmail.com>
wrote:

> hive variables are not replaced on mapreduce jobs but when the query is
> constructed with the variable.
>
> if you are running two difference hivesessions, the variables will not be
> mixed.
>
> If you are setting variables with same name in same hive session then the
> last set value will be picked
>
>
> On Fri, Jun 20, 2014 at 2:44 PM, Bogala, Chandra Reddy <
> Chandra.Bogala@gs.com> wrote:
>
>> How does hive variables work?. if I have multiple Hive jobs running
>> simultaneously? Will they end up picking up values from each other?
>>
>> In automation I am constructing an HQL file by prepending it with some
>> SET statements. I want to make sure if I submit two jobs at the same time
>> that use the same variable names, one job won't pick up values from the
>> other job.
>>
>>
>>
>> Same question from stakeoverflow:
>> http://stackoverflow.com/questions/12464636/how-to-set-variables-in-hive-scripts
>>
>>
>>
>> Thanks,
>>
>> Chandra
>>
>>
>>
>
>
>
> --
> Nitin Pawar
>

Re: hive variables

Posted by Nitin Pawar <ni...@gmail.com>.
hive variables are not replaced on mapreduce jobs but when the query is
constructed with the variable.

if you are running two difference hivesessions, the variables will not be
mixed.

If you are setting variables with same name in same hive session then the
last set value will be picked


On Fri, Jun 20, 2014 at 2:44 PM, Bogala, Chandra Reddy <
Chandra.Bogala@gs.com> wrote:

> How does hive variables work?. if I have multiple Hive jobs running
> simultaneously? Will they end up picking up values from each other?
>
> In automation I am constructing an HQL file by prepending it with some SET
> statements. I want to make sure if I submit two jobs at the same time that
> use the same variable names, one job won't pick up values from the other
> job.
>
>
>
> Same question from stakeoverflow:
> http://stackoverflow.com/questions/12464636/how-to-set-variables-in-hive-scripts
>
>
>
> Thanks,
>
> Chandra
>
>
>



-- 
Nitin Pawar