hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wouter de Bie <wou...@spotify.com>
Subject Re: Simple Hive Query
Date Mon, 05 Mar 2012 11:58:37 GMT
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
> 
> 



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message