You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Techy Teck <co...@gmail.com> on 2012/08/06 20:39:59 UTC

Add Yesterday's date at runtime

I am running *Hive 0.6 *and below is the content I have in *hivetest1.hql*file.

set mapred.job.queue.name=hdmi-technology;
set mapred.output.compress=true;
set mapred.output.compression.type=BLOCK;
set mapred.output.compression.codec=org.apache.hadoop.io.compress.LzoCodec;
add jar UserDefinedFunction.jar;
create temporary function rank as 'com.example.hive.udf.Rank';


insert overwrite table testingtable3 partition (dt='*20120805*')
select * from testingtable3 where dt = '*2012-08-05*';


And I am running the above *hivetest1.hql* file like this from the shell
prompt-

*hive -f hivetest1.hql*
*
*
So my question is- Is there any way to always use the yesterday's date in
the red color whenever I want to run the above *hivetest1.hql file *from
the shell prompt*.*
*
*
Any suggestions will be appreciated.

Re: Add Yesterday's date at runtime

Posted by Vinod Singh <vi...@vinodsingh.com>.
There is no built-in support for such things in Hive. You may like to
explore possibility of doing this via shell script or something else to
calculate date dynamically.

Thanks,
Vinod

On Tue, Aug 7, 2012 at 12:09 AM, Techy Teck <co...@gmail.com> wrote:

> I am running *Hive 0.6 *and below is the content I have in *hivetest1.hql*file.
>
> set mapred.job.queue.name=hdmi-technology;
> set mapred.output.compress=true;
> set mapred.output.compression.type=BLOCK;
> set mapred.output.compression.codec=org.apache.hadoop.io.compress.LzoCodec;
> add jar UserDefinedFunction.jar;
> create temporary function rank as 'com.example.hive.udf.Rank';
>
>
> insert overwrite table testingtable3 partition (dt='*20120805*')
> select * from testingtable3 where dt = '*2012-08-05*';
>
>
> And I am running the above *hivetest1.hql* file like this from the shell
> prompt-
>
> *hive -f hivetest1.hql*
> *
> *
> So my question is- Is there any way to always use the yesterday's date in
> the red color whenever I want to run the above *hivetest1.hql file *from
> the shell prompt*.*
> *
> *
> Any suggestions will be appreciated.
>