Re: How to use the IF conditional function in Hive scripts

2012-09-13 Thread Amila Maha Arachchi
Thanks Kwangjin... On Fri, Sep 14, 2012 at 9:53 AM, Kwangjin Oh wrote: > hive> create table test ( foo string, bar int ) ; > hive> select foo, IF(bar = 0, 'zero', 'not zero') from test; > > > http://www.folkstalk.com/2011/11/conditional-functions-in-hive.html > > > > On 2012-09-14 오후 1:13, Amil

Re: How to use the IF conditional function in Hive scripts

2012-09-13 Thread Kwangjin Oh
hive> create table test ( foo string, bar int ) ; hive> select foo, IF(bar = 0, 'zero', 'not zero') from test; http://www.folkstalk.com/2011/11/conditional-functions-in-hive.html On 2012-09-14 ?? 1:13, Amila Maha Arachchi wrote: Hi Ruslan, Thanks for youe reply. Can you please let me know in

Re: How to use the IF conditional function in Hive scripts

2012-09-13 Thread Amila Maha Arachchi
Hi Ruslan, Thanks for youe reply. Can you please let me know in which situations we can use the IF conditional function (or the CASE function)? Pointing to a sample script would be enough. Thanks, Amila. On Fri, Sep 14, 2012 at 2:27 AM, Ruslan Al-Fakikh wrote: > Hi, > > I guess this goes beyond

Re: How to use the IF conditional function in Hive scripts

2012-09-13 Thread Ruslan Al-Fakikh
Hi, I guess this goes beyond Hive scripts. You can use some kind of an external automation tool like Oozie or a wrapper sh script Ruslan On Thu, Sep 13, 2012 at 3:49 PM, Amila Maha Arachchi wrote: > Hi, > > I am trying to write a hive script which is doing some summarization. There > are two su

How to use the IF conditional function in Hive scripts

2012-09-13 Thread Amila Maha Arachchi
Hi, I am trying to write a hive script which is doing some summarization. There are two summarizations hourly and daily. I want to run the hourly summarization first, then check whether the current timestamp matches some value of my favour (lets say 2012-09-13 23:00:00) and run the daily summariza