You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by hadoop hive <ha...@gmail.com> on 2012/03/05 12:55:04 UTC

Simple Hive Query

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

Re: Simple Hive Query

Posted by Wouter de Bie <wo...@spotify.com>.
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
> 
> 



RE: Simple Hive Query

Posted by "Hamilton, Robert (Austin)" <ro...@hp.com>.
Hi Vikas. You might review your logic. You probably want 'and' instead of 'or' in your where clause.

From: hadoop hive [mailto:hadoophive@gmail.com]
Sent: Monday, March 05, 2012 5:55 AM
To: dev@hive.apache.org; user@hive.apache.org
Subject: Simple Hive Query

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

Re: Simple Hive Query

Posted by Wouter de Bie <wo...@spotify.com>.
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
> 
> 



Re: Hive 0.8.1 build errors using IBM JAVA

Posted by Amir Sanjar <v1...@us.ibm.com>.
I undertsand but IBM JVM  is the only JVM that works on POWER..It looks
like it compiles fine but
it has something to do with packaging.. For some reasons, hbaseXXX jar
files don't get copied to hive-0.8.1/src/build/ivy/lib/default..






From:	Edward Capriolo <ed...@gmail.com>
To:	dev@hive.apache.org
Date:	03/05/2012 10:21 AM
Subject:	Re: Hive 0.8.1 build errors using IBM JAVA



I am sure you are going to love hearing this since you are from IBM,
but there have been a few outstanding issues with Hive and the IBM
jvm.

I just searched to find one as an example.
https://issues.apache.org/jira/browse/HIVE-1686

I am not sure how many users in the wild are running Hive with that
JVM. This does not look like a JVM issue but could be. Do other JVMs
produce the same issue for you?


On Mon, Mar 5, 2012 at 10:55 AM, Amir Sanjar <v1...@us.ibm.com> wrote:
> I am new to HIVE, so forgive me if this is a stupid question :)
> The plan is to build HIVE using IBM JAVA 6, however during the final
steps
> of the build we get below errors, please help:
> Note:   we use command "ant clean package" .. also hbase;0.89.0-SNAPSHOT
> .jar and hbase;0.89.0-SNAPSHOT-test.jar are in .../hive-0.8.1/lib
>
>
>
>
>
>  [echo] Project: hbase-handler
>  [ivy:resolve] :: loading settings :: file
= /home/xxxx/development/hive-0.8.1/src/ivy/ivysettings.xml
>  [ivy:resolve]
>  [ivy:resolve] :::: WARNINGS
>  [ivy:resolve] module not found: org.apache.hbase#hbase;0.89.0-SNAPSHOT
>  [ivy:resolve] ==== apache-snapshot: tried
>  [ivy:resolve]
>
https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
>
https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
>
https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT-tests.jar

>  [ivy:resolve] ==== maven2: tried
>  [ivy:resolve]
http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] ==== datanucleus-repo: tried
>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] ==== hadoop-source: tried
>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] ==== hadoop-source2: tried
>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] -- artifact
org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar

>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve] :: org.apache.hbase#hbase;0.89.0-SNAPSHOT: not found
>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve]
>
>
>
>
>
> Best Regards
> Amir Sanjar
>
> Linux System Management Architect and Lead
> IBM Senior Software Engineer
> Phone# 512-286-8393
> Fax#      512-838-8858
>
>




Re: Hive 0.8.1 build errors using IBM JAVA

Posted by Edward Capriolo <ed...@gmail.com>.
I am sure you are going to love hearing this since you are from IBM,
but there have been a few outstanding issues with Hive and the IBM
jvm.

I just searched to find one as an example.
https://issues.apache.org/jira/browse/HIVE-1686

I am not sure how many users in the wild are running Hive with that
JVM. This does not look like a JVM issue but could be. Do other JVMs
produce the same issue for you?


On Mon, Mar 5, 2012 at 10:55 AM, Amir Sanjar <v1...@us.ibm.com> wrote:
> I am new to HIVE, so forgive me if this is a stupid question :)
> The plan is to build HIVE using IBM JAVA 6, however during the final steps
> of the build we get below errors, please help:
> Note:   we use command "ant clean package" .. also hbase;0.89.0-SNAPSHOT
> .jar and hbase;0.89.0-SNAPSHOT-test.jar are in .../hive-0.8.1/lib
>
>
>
>
>
>  [echo] Project: hbase-handler
>  [ivy:resolve] :: loading settings :: file = /home/xxxx/development/hive-0.8.1/src/ivy/ivysettings.xml
>  [ivy:resolve]
>  [ivy:resolve] :::: WARNINGS
>  [ivy:resolve] module not found: org.apache.hbase#hbase;0.89.0-SNAPSHOT
>  [ivy:resolve] ==== apache-snapshot: tried
>  [ivy:resolve]
>  https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve]
>  https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve]
>  https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT-tests.jar
>  [ivy:resolve] ==== maven2: tried
>  [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] ==== datanucleus-repo: tried
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve] http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve] http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] ==== hadoop-source: tried
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve] http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve] http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] ==== hadoop-source2: tried
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:
>  [ivy:resolve] http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):
>  [ivy:resolve] http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar
>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve] :: org.apache.hbase#hbase;0.89.0-SNAPSHOT: not found
>  [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
>  [ivy:resolve]
>
>
>
>
>
> Best Regards
> Amir Sanjar
>
> Linux System Management Architect and Lead
> IBM Senior Software Engineer
> Phone# 512-286-8393
> Fax#      512-838-8858
>
>

Hive 0.8.1 build errors using IBM JAVA

Posted by Amir Sanjar <v1...@us.ibm.com>.
I am new to HIVE, so forgive me if this is a stupid question :)
The plan is to build HIVE using IBM JAVA 6, however during the final steps
of the build we get below errors, please help:
Note:   we use command "ant clean package" .. also hbase;0.89.0-SNAPSHOT
.jar and hbase;0.89.0-SNAPSHOT-test.jar are in .../hive-0.8.1/lib
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
 [echo] Project: hbase-handler                                                                                                       
 [ivy:resolve] :: loading settings :: file = /home/xxxx/development/hive-0.8.1/src/ivy/ivysettings.xml                               
 [ivy:resolve]                                                                                                                       
 [ivy:resolve] :::: WARNINGS                                                                                                         
 [ivy:resolve] module not found: org.apache.hbase#hbase;0.89.0-SNAPSHOT                                                              
 [ivy:resolve] ==== apache-snapshot: tried                                                                                           
 [ivy:resolve]                                                                                                                       
 https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom       
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:                                                         
 [ivy:resolve]                                                                                                                       
 https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar       
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):                                               
 [ivy:resolve]                                                                                                                       
 https://repository.apache.org/content/repositories/snapshots/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT-tests.jar 
 [ivy:resolve] ==== maven2: tried                                                                                                    
 [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.pom                        
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:                                                         
 [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar                        
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):                                               
 [ivy:resolve] http://repo1.maven.org/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar                        
 [ivy:resolve] ==== datanucleus-repo: tried                                                                                          
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:                                                         
 [ivy:resolve] http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar          
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):                                               
 [ivy:resolve] http://www.datanucleus.org/downloads/maven2/org/apache/hbase/hbase/0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar          
 [ivy:resolve] ==== hadoop-source: tried                                                                                             
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:                                                         
 [ivy:resolve] http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar             
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):                                               
 [ivy:resolve] http://mirror.facebook.net/facebook/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar             
 [ivy:resolve] ==== hadoop-source2: tried                                                                                            
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar:                                                         
 [ivy:resolve] http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar                     
 [ivy:resolve] -- artifact org.apache.hbase#hbase;0.89.0-SNAPSHOT!hbase.jar(test-jar):                                               
 [ivy:resolve] http://archive.cloudera.com/hive-deps/hadoop/core/hbase-0.89.0-SNAPSHOT/hbase-0.89.0-SNAPSHOT.jar                     
 [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::                                                                        
 [ivy:resolve] :: UNRESOLVED DEPENDENCIES ::                                                                                         
 [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::                                                                        
 [ivy:resolve] :: org.apache.hbase#hbase;0.89.0-SNAPSHOT: not found                                                                  
 [ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::                                                                        
 [ivy:resolve]                                                                                                                       
                                                                                                                                     
                                                                                                                                     



Best Regards
Amir Sanjar

Linux System Management Architect and Lead
IBM Senior Software Engineer
Phone# 512-286-8393
Fax#      512-838-8858