You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Kayla Schultz <sc...@gmail.com> on 2012/05/08 21:19:21 UTC

Hive error when running a count query.

The query I'm trying to run is: select count(*) from customers;
The table exists and there is data in it. However when I run this command I
get the following: http://imgur.com/sOXXB and the error log shows:
http://imgur.com/5EWrS
Any idea what I'm doing wrong?

Sorry about the logs being pictures, was the easiest way to copy from my vm.

Kayla

Re: Hive error when running a count query.

Posted by shashwat shriparv <dw...@gmail.com>.
When ever you execute any query except "select * from tablename" hive runs
mapreduce job in background for which it needs hadoop to be properly
configured and proper commication between hadoop and hive. the error you
specified happens when the hive not able to connect to hadoop properly


here is the solution you can try :

1. Chown of the hive folder
2. change permission of hive folder to 755
3. Set this to hive-site.xml

<property>
    <name>hive.exec.scratchdir</name>
    <value>/home/yourusername/mydir</value>
    <description>Scratch space for Hive jobs</description>
  </property>


3. put

hadoop-0.20-core.jar
hive/lib/hive-exec-0.7.1.jar
hive/lib/hive-jdbc-0.7.1.jar
hive/lib/hive-metastore-0.7.1.jar
hive/lib/hive-service-0.7.1.jar
hive/lib/libfb303.jar
lib/commons-logging-1.0.4.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar

these file to hive lib folder


Define external jar in hive site xml file as follows :


IN hive-env.sh change following:


# Set HADOOP_HOME to point to a specific hadoop install directory

#here instead of path what i have given you give your own path where
hadoop #is there
export HADOOP_HOME=/home/shashwat/Hadoop/hadoop-0.20.205

# Hive Configuration Directory can be controlled by:

#here you specify the conf directory path of hive
export HIVE_CONF_DIR=/home/shashwat/Hadoop/hive-0.7.1/conf

#Folder containing extra ibraries required for hive compilation/execution

#can be controlled by:

#here you specify the lib file directory, here you can specify the lib

#directory of hadoop lib folder too like follows:
export HIVE_AUX_JARS_PATH=/home/shashwat/Hadoop/hive-0.7.1/lib:/home/shashwat/Hadoop/hadoop-0.20.205/lib:/home/shashwat/Hadoop/hbase/lib




and also in hive-site.xml



  <property>
    <name>hive.aux.jars.path</name>
 <value>file:///home/shashwat/Hadoop/hive-0.7.1/lib/hive-hbase-handler-0.7.1.jar,file:///home/shashwat/Hadoop/hive-0.7.1/lib/hbase-0.90.4.jar,file:///home/shashwat/Hadoop/hive-0.7.1/lib/zookeeper-3.3.1.jar</value>
  </property>


by default if you have just downloaded the hive there will not be
hive-site.xml or hive-env.sh by default in conf dir there will be
hive-site.xml.template and same for the hive-env.sh so make a backupe
of both and rename hive-site.xml.template to hive-site.xml and
hive-env.sh.template to hive-env.sh and make the changes what i
suggested...



Note : when ever you download something and extract in linux dont
forget to change owner and change mode using chown and chmod for the
folder recursively


Hope this will help you..

Cheer


∞

Shashwat Shriparv




On Wed, May 9, 2012 at 12:49 AM, Kayla Schultz <sc...@gmail.com>wrote:

> The query I'm trying to run is: select count(*) from customers;
> The table exists and there is data in it. However when I run this command
> I get the following: http://imgur.com/sOXXB and the error log shows:
> http://imgur.com/5EWrS
> Any idea what I'm doing wrong?
>
> Sorry about the logs being pictures, was the easiest way to copy from my
> vm.
>
> Kayla
>
>


-- 


∞
Shashwat Shriparv