1
votes

I'm trying to load data from a csv file on my local machine to a test database created on Hive using the following command

LOAD DATA LOCAL INPATH 'bdata/tx/TX_2012.csv' 
INTO TABLE testdb PARTITION(dt='08-09-2012');

However, I keep getting the following error:

Copying file: file:/root/business-data/sc_sd_tn_tx_ut/TX_6_17_2012.csv
Failed with exception java.io.IOException: File /tmp/hive-root/hive_2012-08-09_13-21-   49_208_3491106775735913267/-ext-10000/TX_6_17_2012.csv could only be replicated to 0 nodes, instead of 1
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1558)
at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:696)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.CopyTask

I can't seem to figure out what it is that's causing this error. I've even tried reinstalling and re-configuring Hive on single-node and multi-node clusters, but I still get the same error. Would anyone be able to explain what the error is and point me in the right direction?

Note : I'm using Hadoop 1.0.3 and Hive-0.8.1 and followed the following tutorials for installation and configuration:

https://cwiki.apache.org/confluence/display/Hive/GettingStarted

http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/

1

1 Answers

0
votes

The line

could only be replicated to 0 nodes, instead of 1

makes me think this is a datanode issue. Do you have at least one datanode running in the hadoop cluster on which the Hive DB is?