hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya Singh30 <>
Subject RE: Mysql metastore configuration error.
Date Tue, 22 Nov 2011 07:26:16 GMT
Sorry It was a typo..

I used "Load data local inpath 'path/to/abcd.txt' into table abcd;" only

Thanks for pointing it out Stephen.


From: Stephen Boesch []
Sent: Tuesday, November 22, 2011 12:32 PM
Subject: Re: Mysql metastore configuration error.

Was that code above  verbatim?
because there is a typo

Hive> Load sata local inpath 'path/to/abcd.txt' into table abcd;

(load sata not load data)
2011/11/21 Aditya Singh30 <<>>
Hi Everybody,
                                I am using Apache's Hadoop-0.20.2 and Apache's Hive-0.7.0.
I have a 2 node cluster. One Redhat Linux 6.0(Hadoop Server) and other Windows 7 using Cygwin.
The Hadoop cluster is working fine. I have checked by executing various examples provided
with Hadoop. Map reduce jobs are being executed fine. For Hive I am using MySQL for metastore
with following configuration is hive-site.xml :







I created the DB and hiveuser in mysql using following commands:
mysql> CREATE DATABASE metastore;
mysql> USE metastore;
mysql> SOURCE /usr/local/hive/scripts/metastore/upgrade/mysql/hive-schema-0.7.0.mysql.sql;

mysql> CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'hiveuser';
mysql> GRANT ALL ON metastore.* TO 'hiveuser'@'%';

I created a table using the following command on hive:
hive> Create table abcd(ab int, cd string) row format delimited fields terminated by '#'
stored as textfile;

Then I created a file abcddata.txt containing the following data

Then I loaded this data into table abcd using :
Hive> Load sata local inpath 'path/to/abcd.txt' into table abcd;

Now when I execute "select * from abcd" it runs successfully and shows the data in abcd.
But if I run "select ab from abcd" or " select * from abcd where cd='aa'" it returns error:

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask

In the logs I found:
Caused by: java.util.NoSuchElementException
        at java.util.Vector.lastElement(
        at com.sun.beans.ObjectHandler.lastExp(
        at com.sun.beans.ObjectHandler.dequeueResult(
        at java.beans.XMLDecoder.readObject(
        at org.apache.hadoop.hive.ql.exec.Utilities.deserializeMapRedWork(
        at org.apache.hadoop.hive.ql.exec.Utilities.getMapRedWork(

And when I tried to access Hive from a java program using connection string:
Running command "describe abcd" it returns:
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table
'metastore.abcd' doesn't exist

Then on the mysql server I ran:
mysql> use metastore;
mysql> show tables;

The table abcd is not there. The table is not being stored in the mysql metastore db.
So how come on Hive CLI, when I do "select * from abcd" it shows the data in the table. And
"show tables" shows abcd there. It means Hive CLI is not using the mysql metastore for storing
and "select *" statement but whenever it's a statement that requires map reduce jobs or while
accessing via java program using connection string it uses mysql metastore. It must be some
configuration mistake I think. Please help me out.

Aditya Singh
Infosys, India.

**************** CAUTION - Disclaimer *****************

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are not

to copy, disclose, or distribute this e-mail or its contents to any other person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has taken

every reasonable precaution to minimize this risk, but is not liable for any damage

you may sustain as a result of any virus in this e-mail. You should carry out your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS******** End of Disclaimer ********INFOSYS***

View raw message