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 DABFF97B7 for ; Sun, 30 Sep 2012 13:28:23 +0000 (UTC) Received: (qmail 99822 invoked by uid 500); 30 Sep 2012 13:28:22 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 99778 invoked by uid 500); 30 Sep 2012 13:28:22 -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 99768 invoked by uid 99); 30 Sep 2012 13:28:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2012 13:28:22 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bejoyks@outlook.com designates 65.54.51.78 as permitted sender) Received: from [65.54.51.78] (HELO snt0-omc3-s41.snt0.hotmail.com) (65.54.51.78) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2012 13:28:16 +0000 Received: from SNT002-W136 ([65.55.90.137]) by snt0-omc3-s41.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 30 Sep 2012 06:27:55 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_16aa5604-6f94-462f-b865-c89b66faabf6_" X-Originating-IP: [59.93.39.128] From: Bejoy KS To: "user@hive.apache.org" Subject: RE: how to perform GROUP BY:: in pig for this Date: Sun, 30 Sep 2012 18:57:55 +0530 Importance: Normal In-Reply-To: <2ADA1B0170E3434DA763D609DCD01EB5436BEC02@BLR-EC-MBX7.wipro.com> References: <2ADA1B0170E3434DA763D609DCD01EB5436BEBE4@BLR-EC-MBX7.wipro.com>,<2ADA1B0170E3434DA763D609DCD01EB5436BEC02@BLR-EC-MBX7.wipro.com> MIME-Version: 1.0 X-OriginalArrivalTime: 30 Sep 2012 13:27:55.0319 (UTC) FILETIME=[664BEC70:01CD9F0F] X-Virus-Checked: Checked by ClamAV on apache.org --_16aa5604-6f94-462f-b865-c89b66faabf6_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Yogesh If you are looking for the solution in hive=2C then the following query wil= l get you the required result Select month(Date)=2C max(rate) from date_sample Group BY month(Date)=3B Regards Bejoy KS > From: yogesh.kumar13@wipro.com > To: user@hive.apache.org > CC: Yogeshdhari@live.com > Subject: FW: how to perform GROUP BY:: in pig for this > Date: Sat=2C 29 Sep 2012 11:22:29 +0000 >=20 >=20 >=20 > Hi all=2C >=20 > I have this data=2C having fields (Date=2C symbol=2C rate) >=20 > and I want it to be group by Months=2C and to find out the maximum rate v= alue for each month. >=20 > like: for month (08=2C 36.3)=2C (09=2C 36.4)=2C (10=2C 36.8)=2C (11=2C 37= .5) .. >=20 >=20 > (2009-08-21=2CCLI=2C33.38) > (2009-08-24=2CCLI=2C33.03) > (2009-08-25=2CCLI=2C33.16) > (2009-08-26=2CCLI=2C32.78) > (2009-08-27=2CCLI=2C32.79) > (2009-08-28=2CCLI=2C33.37) > (2009-08-31=2CCLI=2C32.51) > (2009-09-11=2CCLI=2C34.08) > (2009-09-14=2CCLI=2C35.19) > (2009-09-15=2CCLI=2C35.82) > (2009-09-16=2CCLI=2C36.58) > (2009-09-17=2CCLI=2C37.63) > (2009-09-18=2CCLI=2C37.26) > (2009-09-21=2CCLI=2C36.31) > (2009-09-22=2CCLI=2C35.88) > (2009-09-23=2CCLI=2C35.84) > (2009-09-24=2CCLI=2C33.98) > (2009-09-25=2CCLI=2C32.44) > (2009-09-28=2CCLI=2C33.34) > (2009-09-29=2CCLI=2C33.6) > (2009-09-30=2CCLI=2C33.24) > (2009-10-01=2CCLI=2C31.98) > (2009-10-02=2CCLI=2C31.21) > (2009-10-05=2CCLI=2C31.31) > (2009-10-21=2CCLI=2C32.86) > (2009-10-26=2CCLI=2C33.15) > (2009-10-27=2CCLI=2C32.71) > (2009-10-28=2CCLI=2C32.03) > (2009-10-29=2CCLI=2C32.05) > (2009-10-30=2CCLI=2C31.88) > (2009-11-02=2CCLI=2C31.88) > (2009-11-03=2CCLI=2C31.16) > (2009-11-04=2CCLI=2C31.47) > (2009-11-09=2CCLI=2C31.59) > (2009-11-25=2CCLI=2C30.58) > (2009-11-27=2CCLI=2C30.19) > (2009-11-30=2CCLI=2C30.86) > (2009-12-01=2CCLI=2C31.74) > (2009-12-02=2CCLI=2C32.62) > (2009-12-03=2CCLI=2C33.43) > (2009-12-04=2CCLI=2C34.12) > (2009-12-07=2CCLI=2C33.77) > (2009-12-08=2CCLI=2C33.8) > (2009-12-09=2CCLI=2C33.71) >=20 > Please help and suggest . >=20 > Thanks & Regards > Yogesh Kumar >=20 > The information contained in this electronic message and any attachments = to this message are intended for the exclusive use of the addressee(s) and = may contain proprietary=2C confidential or privileged information. If you a= re not the intended recipient=2C you should not disseminate=2C distribute o= r copy this e-mail. Please notify the sender immediately and destroy all co= pies of this message and any attachments.=20 >=20 > WARNING: Computer viruses can be transmitted via email. The recipient sho= uld check this email and any attachments for the presence of viruses. The c= ompany accepts no liability for any damage caused by any virus transmitted = by this email. >=20 > www.wipro.com = --_16aa5604-6f94-462f-b865-c89b66faabf6_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Yogesh

If you are look= ing for the solution in hive=2C then the following query will get you the r= equired result

Select month(Date)=2C max(rate) from date_sample Grou= p BY month(Date)=3B


Regards
Bejoy KS



>=3B From: yoge= sh.kumar13@wipro.com
>=3B To: user@hive.apache.org
>=3B CC: Yoges= hdhari@live.com
>=3B Subject: FW: how to perform GROUP BY:: in pig for= this
>=3B Date: Sat=2C 29 Sep 2012 11:22:29 +0000
>=3B
>= =3B
>=3B
>=3B Hi all=2C
>=3B
>=3B I have this data= =2C having fields (Date=2C symbol=2C rate)
>=3B
>=3B and I want= it to be group by Months=2C and to find out the maximum rate value for eac= h month.
>=3B
>=3B like: for month (08=2C 36.3)=2C (09=2C 36.4)= =2C (10=2C 36.8)=2C (11=2C 37.5) ..
>=3B
>=3B
>=3B (2009-0= 8-21=2CCLI=2C33.38)
>=3B (2009-08-24=2CCLI=2C33.03)
>=3B (2009-08= -25=2CCLI=2C33.16)
>=3B (2009-08-26=2CCLI=2C32.78)
>=3B (2009-08-= 27=2CCLI=2C32.79)
>=3B (2009-08-28=2CCLI=2C33.37)
>=3B (2009-08-3= 1=2CCLI=2C32.51)
>=3B (2009-09-11=2CCLI=2C34.08)
>=3B (2009-09-14= =2CCLI=2C35.19)
>=3B (2009-09-15=2CCLI=2C35.82)
>=3B (2009-09-16= =2CCLI=2C36.58)
>=3B (2009-09-17=2CCLI=2C37.63)
>=3B (2009-09-18= =2CCLI=2C37.26)
>=3B (2009-09-21=2CCLI=2C36.31)
>=3B (2009-09-22= =2CCLI=2C35.88)
>=3B (2009-09-23=2CCLI=2C35.84)
>=3B (2009-09-24= =2CCLI=2C33.98)
>=3B (2009-09-25=2CCLI=2C32.44)
>=3B (2009-09-28= =2CCLI=2C33.34)
>=3B (2009-09-29=2CCLI=2C33.6)
>=3B (2009-09-30= =2CCLI=2C33.24)
>=3B (2009-10-01=2CCLI=2C31.98)
>=3B (2009-10-02= =2CCLI=2C31.21)
>=3B (2009-10-05=2CCLI=2C31.31)
>=3B (2009-10-21= =2CCLI=2C32.86)
>=3B (2009-10-26=2CCLI=2C33.15)
>=3B (2009-10-27= =2CCLI=2C32.71)
>=3B (2009-10-28=2CCLI=2C32.03)
>=3B (2009-10-29= =2CCLI=2C32.05)
>=3B (2009-10-30=2CCLI=2C31.88)
>=3B (2009-11-02= =2CCLI=2C31.88)
>=3B (2009-11-03=2CCLI=2C31.16)
>=3B (2009-11-04= =2CCLI=2C31.47)
>=3B (2009-11-09=2CCLI=2C31.59)
>=3B (2009-11-25= =2CCLI=2C30.58)
>=3B (2009-11-27=2CCLI=2C30.19)
>=3B (2009-11-30= =2CCLI=2C30.86)
>=3B (2009-12-01=2CCLI=2C31.74)
>=3B (2009-12-02= =2CCLI=2C32.62)
>=3B (2009-12-03=2CCLI=2C33.43)
>=3B (2009-12-04= =2CCLI=2C34.12)
>=3B (2009-12-07=2CCLI=2C33.77)
>=3B (2009-12-08= =2CCLI=2C33.8)
>=3B (2009-12-09=2CCLI=2C33.71)
>=3B
>=3B Pl= ease help and suggest .
>=3B
>=3B Thanks &=3B Regards
>= =3B Yogesh Kumar
>=3B
>=3B The information contained in this ele= ctronic message and any attachments to this message are intended for the ex= clusive use of the addressee(s) and may contain proprietary=2C confidential= or privileged information. If you are not the intended recipient=2C you sh= ould not disseminate=2C distribute or copy this e-mail. Please notify the s= ender immediately and destroy all copies of this message and any attachment= s.
>=3B
>=3B WARNING: Computer viruses can be transmitted via e= mail. The recipient should check this email and any attachments for the pre= sence of viruses. The company accepts no liability for any damage caused by= any virus transmitted by this email.
>=3B
>=3B www.wipro.com
= --_16aa5604-6f94-462f-b865-c89b66faabf6_--