Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B2D3A1180B for ; Sun, 24 Aug 2014 07:09:45 +0000 (UTC) Received: (qmail 28528 invoked by uid 500); 24 Aug 2014 07:09:44 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 28457 invoked by uid 500); 24 Aug 2014 07:09:44 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 28447 invoked by uid 99); 24 Aug 2014 07:09:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Aug 2014 07:09:43 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of karthiksrivasthava@gmail.com designates 209.85.216.48 as permitted sender) Received: from [209.85.216.48] (HELO mail-qa0-f48.google.com) (209.85.216.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Aug 2014 07:09:16 +0000 Received: by mail-qa0-f48.google.com with SMTP id m5so11099760qaj.7 for ; Sun, 24 Aug 2014 00:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9G++NvgmZZ3GKsCtl/CZ6Vwwbp86xm8nlP9hp8/nNog=; b=NqutU11YupO95pqm5ytlUcxrm/KlYRynSsesu0y9tJDa4m/cqzmmoLUOAs1S4ZMAW1 smGvdhW0PqgnHI6wGZbw8d5RWM4zZbtnQ4Bcih0UTgdIh2SNQ4DgWWI1YRHSeE4AYFQZ jEcbq2EOM6eQ82nIVu9Cged2/fipaWOLZ/7e0txUpJ2qbEnW1qqFYCexkn6w1+nBTGYc 3s+86iSSjVw8SllF+W/+s43moYcOPs4MEHEgBX68aIBjcng7bQk6LVSYRm23iwDZMPol nGId5i+x2j/QhNRSc119+comTOWXcxXCvwJtKBnounbVH0p4skdZQD4zkcEe3STSxHMJ 12xQ== MIME-Version: 1.0 X-Received: by 10.224.137.65 with SMTP id v1mr23106285qat.53.1408864155512; Sun, 24 Aug 2014 00:09:15 -0700 (PDT) Received: by 10.229.114.138 with HTTP; Sun, 24 Aug 2014 00:09:15 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Aug 2014 02:09:15 -0500 Message-ID: Subject: Re: List of dates as arguments From: karthik Srivasthava To: user@hive.apache.org Content-Type: multipart/alternative; boundary=001a11c2cc3086b45d05015abfe8 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2cc3086b45d05015abfe8 Content-Type: text/plain; charset=UTF-8 Nitin, Teja Thank you.. I exactly need what Teja suggested... i need list of dates between start date and end date.... On Sun, Aug 24, 2014 at 2:05 AM, Teja Kunapareddy wrote: > Thanks Nithin For your reply.. I can get start date and end date,. But can > i get all the dates with in START DATE AND END DATE.??? . so that my query > looks something like this > > "Select a, b, c from table_x where date in (${hiveconf:LIST_OF DATES})" > > > > On 24 August 2014 01:18, Nitin Pawar wrote: > >> with your shell script calculate your start date and end date >> hive $HIVEPARAMS -hiveconf startdate="$var1" -hiveconf enddate="$var2" >> >> also set in ..hiverc >> set hive.variable.substitute=true; >> >> >> On Sun, Aug 24, 2014 at 10:19 AM, karthik Srivasthava < >> karthiksrivasthava@gmail.com> wrote: >> >>> As my raw-data table is partitioned by date.. i want to get data to run >>> a query every days to find top 10 products in last 15 days . >>> >>> How to pass list of dates dynamically as arguments in hive query using >>> hiveconf? >>> >>> >>> >> >> >> -- >> Nitin Pawar >> > > --001a11c2cc3086b45d05015abfe8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Nitin,
Teja

Thank you.. I exa= ctly need what Teja suggested... i need list of dates between start date an= d end date....=C2=A0


On Sun, Aug 24, 2014 at 2:05 AM, Teja Kunapareddy <tejakunapareddy= @gmail.com> wrote:
Thanks Nithin For your reply.. I can get start d= ate and end date,. But can i get all the dates with in START DATE AND END D= ATE.??? . so that my query looks something like this

"Select =C2=A0a, b, c from table_x where= date in =C2=A0(${hiveconf:LIST_OF DATES})" =C2=A0=C2=A0

On 24 August 2014 01:18, Nitin Pawar <nitinpawar432@gmail.com> wrote:
with your shell scrip= t calculate your start date and end date=C2=A0
hive $HIVEPARAMS -hiveconf startdate=3D"$var1" =C2=A0-hiveconf e= nddate=3D"$var2"=C2=A0

also set in ..hiverc=C2=A0
set hive.variable.substitute=3Dtrue;


On Sun, Aug 24, 2014 at 10:19 AM, karthik Srivasthava <ka= rthiksrivasthava@gmail.com> wrote:
As my raw-data table is partitioned = by date.. i want to get data to run a query every days to find top 10 produ= cts in last 15 days .

How to pass list of dates dynamically as arguments in h= ive query using hiveconf?





--
Nitin Pawar


--001a11c2cc3086b45d05015abfe8--