Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Passing date as command line arguments


Copy link to this message
-
Re: Passing date as command line arguments
You can try it out on a local installation and test it against the later versions.

As I pointed out, I just tested on hive 0.9 and it was working good for me.

I guess you should recommend an upgrade of hive in your cluster as well. Hive has gone far too ahead after 0.6 . :)
Regards
Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: Techy Teck <[EMAIL PROTECTED]>
Date: Sat, 4 Aug 2012 00:30:41
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Passing date as command line arguments

I cannot try that on Higher version of Hive as I am working in a company
where they have installed only Hive 0.6 on the Ares cluster.

:(
On Sat, Aug 4, 2012 at 12:29 AM, Bejoy KS <[EMAIL PROTECTED]> wrote:

> **
>
> Try it on a higher version of hive and let me know if that doesn't work
> still. 0.9 should be good.
>
>
> Regards
> Bejoy KS
>
> Sent from handheld, please excuse typos.
> ------------------------------
> *From: * Techy Teck <[EMAIL PROTECTED]>
> *Date: *Sat, 4 Aug 2012 00:26:44 -0700
> *To: *<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> *ReplyTo: * [EMAIL PROTECTED]
> *Subject: *Re: Passing date as command line arguments
>
> Yes it is String for me here.
>
> This is the table structure by the way-
>
> *create table lip_data_quality*
> *( buyer_id bigint,*
> *  total_chkout bigint,*
> *  total_errpds bigint*
> * )*
> * partitioned by (dt string)*
> *row format delimited fields terminated by '\t'*
> *stored as sequencefile*
> *location '/apps/hdmi-technology/b_apdpds/lip-data-quality'*
> *;*
>
> in which I am using dt in the where clause in my query. I am running *Hive
> 0.6.*
>
>
>
> On Sat, Aug 4, 2012 at 12:24 AM, Bejoy KS <[EMAIL PROTECTED]> wrote:
>
>> **
>> I tried the same query on my end, It is working fine for me without any
>> issues.
>>
>> By de way the data type for 'dt' is String itself right?
>> Regards
>> Bejoy KS
>>
>> Sent from handheld, please excuse typos.
>> ------------------------------
>> *From: * Techy Teck <[EMAIL PROTECTED]>
>> *Date: *Sat, 4 Aug 2012 00:21:37 -0700
>> *To: *<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>> *ReplyTo: * [EMAIL PROTECTED]
>> *Subject: *Re: Passing date as command line arguments
>>
>> I was not able to understand. So what changes I need to make? This is my
>> below *hivetest1.hql-*
>> *
>> *
>> *select * from lip_data_quality where dt = '${hiveconf:start_date}';*
>> *
>> *
>> And by this I am executing the above hql file-
>>
>> *hive -f hivetest1.hql -hiveconf start_date=20120709*
>> *
>> *
>> *
>> *
>> Any thoughts what changes I need to make?
>>
>>
>>
>>
>>
>>
>>
>> On Sat, Aug 4, 2012 at 12:16 AM, Bejoy KS <[EMAIL PROTECTED]> wrote:
>>
>>> **
>>> Yes.
>>>
>>> From the logs the query being executed is
>>> select * from lip_data_quality where dt=20120709
>>>
>>> But here the dt is not in quotes. It should be like
>>> select * from lip_data_quality where dt='20120709';
>>> Regards
>>> Bejoy KS
>>>
>>> Sent from handheld, please excuse typos.
>>> ------------------------------
>>> *From: * Techy Teck <[EMAIL PROTECTED]>
>>> *Date: *Sat, 4 Aug 2012 00:07:07 -0700
>>> *To: *<[EMAIL PROTECTED]>; Bejoy Ks<[EMAIL PROTECTED]>
>>> *ReplyTo: * [EMAIL PROTECTED]
>>> *Subject: *Re: Passing date as command line arguments
>>>
>>> I found this thing from the Hive log. This is what you are looking for?-
>>>
>>> *SessionStart SESSION_ID="rjamal_201208041359" TIME="1344063565655"*
>>> *QueryStart QUERY_STRING="select * from lip_data_quality where
>>> dt=20120709"
>>> QUERY_ID="rjamal_20120804135959_58e245e8-086a-47c2-9ed3-6b952e4a5486"
>>> TIME="1344063597488"*
>>> *Counters
>>> plan="{"queryId":"rjamal_20120804135959_58e245e8-086a-47c2-9ed3-6b952e4a5486","queryType":null,"queryAttributes":{"queryString":"select
>>> * from lip_data_quality where dt=20120709"},"queryCo*
>>> *unters":"null","stageGraph":{"nodeType":"1","roots":"null","adjacencyList":"]"},"stageList":"]","done":"false","started":"true"}"