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 3D4B898A8 for ; Mon, 5 Mar 2012 11:59:12 +0000 (UTC) Received: (qmail 51125 invoked by uid 500); 5 Mar 2012 11:59:11 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 50959 invoked by uid 500); 5 Mar 2012 11:59:11 -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 50946 invoked by uid 99); 5 Mar 2012 11:59:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 11:59:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of wouter@spotify.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-lpp01m010-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 11:59:03 +0000 Received: by lagu2 with SMTP id u2so5800206lag.35 for ; Mon, 05 Mar 2012 03:58:41 -0800 (PST) Received-SPF: pass (google.com: domain of wouter@spotify.com designates 10.112.27.165 as permitted sender) client-ip=10.112.27.165; Authentication-Results: mr.google.com; spf=pass (google.com: domain of wouter@spotify.com designates 10.112.27.165 as permitted sender) smtp.mail=wouter@spotify.com Received: from mr.google.com ([10.112.27.165]) by 10.112.27.165 with SMTP id u5mr9355825lbg.48.1330948721330 (num_hops = 1); Mon, 05 Mar 2012 03:58:41 -0800 (PST) Received: by 10.112.27.165 with SMTP id u5mr7734517lbg.48.1330948721186; Mon, 05 Mar 2012 03:58:41 -0800 (PST) Received: from mini-me.local (23.60.236.194.office.spotify.net. [194.236.60.23]) by mx.google.com with ESMTPS id o3sm22847610lbn.2.2012.03.05.03.58.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 03:58:40 -0800 (PST) Date: Mon, 5 Mar 2012 12:58:37 +0100 From: Wouter de Bie To: user@hive.apache.org Cc: dev@hive.apache.org Message-ID: In-Reply-To: References: Subject: Re: Simple Hive Query X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4f54aa6d_4d32ab86_db" X-Gm-Message-State: ALoCoQlMZmdFlAZFQDkDzBwF79s4aPAecqy18IWEVGBqCI2emd53ajEXOIDSqd+tDOqSK9QRk4cy X-Virus-Checked: Checked by ClamAV on apache.org --4f54aa6d_4d32ab86_db Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Your table specifies 3 ints, however, some of your rows contain strings. If you specify you table as strings and then later parse the fields to an int (by doing some replacements and casting it to an int), it should work. // Wouter On Monday, March 5, 2012 at 12:55 PM, hadoop hive wrote: > Hi Folks , > > i m facing a problem like i have a table a(k1 int ,k2 int ,k3 int ); > > and data present is like > > *9,*1,*3 > 3,4,5 > 12,32,54 > *9,12,32 > 12,*9,21 > > i need row which doesn't have *9 in any fields. > > i wrote a query > > 1: select k1,k2,k3 from a where (k1<>'\*9' or k2<>'\*9' or k3<>'\*9'); > > 2: select k1,k2,k3 from a where (k1<>'*9' or k2<>'*9' or k3<>'*9'); > > 3: select k1,k2,k3 from a where (k1<>"*9" or k2<>"*9" or k3<>"*9"); > > any of these case is not working. > > i need the result like > > *9,*1,*3 > 3,4,5 > 12,32,54 > *9,12,32 > 12,*9,21 > > > Thanks > Vikas Srivastava > > --4f54aa6d_4d32ab86_db Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi,

Your table specifies 3 ints, however, some of = your rows contain strings. If you specify you table as strings and then l= ater parse the fields to an int (by doing some replacements and casting i= t to an int), it should work.

// Wouter

=20

On Monday, March 5, 20= 12 at 12:55 PM, hadoop hive wrote:

Hi =46olks ,

i m f= acing a problem like i have a table a(k1 int ,k2 int ,k3 int   );

and data present is like 

*9,*1,*3
3,4,5
12,32,54
*9,12,32
12,*9,21

i need row whic= h doesn't have *9 in any fields.

i wrote a query=

1: select k1,k2,k3 from a where (k1<>'=5C= *9' or k2<>'=5C*9' or k3<>'=5C*9');

2: select k1,k2,k3 from a where (k1<>'*9' = or k2<>'*9' or k3<>'*9');

= 3: select k1,k2,k3 from a where (k1<>=22*9=22 or k2&= lt;>=22*9=22 or k3<>=22*9=22);

any of these case is not working.

i need the result like

*9,*1,*3
=
3,4,5
12,32,54
*9,12,32
12,*9,21


Than= ks 
Vikas Srivastava
=20 =20 =20 =20
=20

--4f54aa6d_4d32ab86_db--