On Sat, Mar 12, 2011 at 1:46 PM, Tim Robertson <timrobertson...@gmail.com> wrote: > Hi all > > Can someone please tell me how to achieve the following in a single hive > script? > > set original_value = mapred.reduce.tasks; > set mapred.reduce.tasks=1; > ... do stuff > set mapred.reduce.tasks=original_value; > > It is the first and last lines that don't work - is it possible? > > Thanks, > Tim >
If you are using hive 0.7.0 you can use the newly added "hive variables" feature :) http://svn.apache.org/repos/asf/hive/trunk/docs/xdocs/language_manual/var_substitution.xml set x=5 set y=${hiveconf:x}