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

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


+
Techy Teck 2012-08-03, 22:48
+
Matt Tucker 2012-08-04, 02:15
+
Techy Teck 2012-08-04, 06:06
+
Vijay 2012-08-04, 06:32
+
Techy Teck 2012-08-04, 06:41
+
Bejoy Ks 2012-08-04, 06:52
+
Techy Teck 2012-08-04, 06:58
+
Techy Teck 2012-08-04, 07:07
+
Bejoy KS 2012-08-04, 07:16
+
Techy Teck 2012-08-04, 07:21
Copy link to this message
-
Re: Passing date as command line arguments
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.

-----Original Message-----
From: Techy Teck <[EMAIL PROTECTED]>
Date: Sat, 4 Aug 2012 00:21:37
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Reply-To: [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"}"
> TIME="1344063597501"*
> *QueryEnd QUERY_STRING="select * from lip_data_quality where dt=20120709"
> QUERY_ID="rjamal_20120804135959_58e245e8-086a-47c2-9ed3-6b952e4a5486"
> QUERY_RET_CODE="0" QUERY_NUM_TASKS="0" TIME="134406359*
> *7503"*
> *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":"true","started":"true"}"
> TIME="1344063597504"*
> *
> *
> *
> *
>
>
>
> On Fri, Aug 3, 2012 at 11:58 PM, Techy Teck <[EMAIL PROTECTED]>wrote:
>
>> Yes that query gives me the result back correctly.
>>
>> How can I see the hive log Bejoy?  Basically I am not sure which hive log
>> and what is the path where I can see that thing?
>>
>>
>>
>>
>>
>>
>> On Fri, Aug 3, 2012 at 11:52 PM, Bejoy Ks <[EMAIL PROTECTED]> wrote:
>>
>>>  Hi Techy
>>>
>>> Are you getting the results for the same query directly from CLI, I mean
>>> does the below query return correct results
>>> select * from lip_data_quality where dt = '20120709';
>>>
>>> If the above query returns results, can you check the hive logs and see
>>> what is the actual query being executed?
>>>
>>> Regards,
>>> Bejoy KS
>>>
>>>   ------------------------------
>>> *From:* Techy Teck <[EMAIL PROTECTED]>
>>> *To:* [EMAIL PROTECTED]
>>> *Cc:* Vijay Dirisala <[EMAIL PROTECTED]>
>>> *Sent:* Saturday, August 4, 2012 12:11 PM
>>> *Subject:* Re: Passing date as command line arguments
>>>
>>> Thanks Vijay for the suggestion. I also tried that and it still didn't
>>> worked for me.
>>>
>>> Any thoughts why it is not working?
>>>
>>>
>>>
>>>
>>> On Fri, Aug 3, 2012 at 11:32 PM, Vijay <[EMAIL PROTECTED]> wrote:
>>>
>>> There can't be a space in the variable name. Try this:
>>> ${hiveconf:start_date}
>>>
>>> On Fri, Aug 3, 2012 at 11:06 PM, Techy Teck <[EMAIL PROTECTED]>
+
Bejoy KS 2012-08-04, 07:27
+
Techy Teck 2012-08-04, 07:29
+
Techy Teck 2012-08-04, 07:26
+
Bejoy KS 2012-08-04, 07:29
+
Techy Teck 2012-08-04, 07:30
+
Techy Teck 2012-08-04, 07:35
+
Bejoy KS 2012-08-04, 07:39
+
Lefty Leverenz 2012-08-04, 07:58
+
Edward Capriolo 2012-08-04, 14:19
+
Bejoy KS 2012-08-04, 07:35
+
Techy Teck 2012-08-04, 07:37
+
Techy Teck 2012-08-04, 06:01