【发布时间】:2014-04-29 04:42:28
【问题描述】:
我正在使用 Apache hadoop 1.1.1 和 Apache hbase 0.94.3。我想将数据从 HDFS 加载到 HBASE。 我写了猪脚本来达到这个目的。首先,我在 habse 中创建了 hbase 表,然后编写了 pig 脚本以将数据从 HDFS 加载到 HBASE。但它没有将数据加载到 hbase 表中。不知道穿到哪里去了。 以下是用于创建 hbase 表的命令:
创建表'mydata','mycf'
下面是从hdfs加载数据到hbase的pig脚本:
A = LOAD '/user/hduser/Dataparse/goodrec1.txt' USING PigStorage(',') as (c1:int, c2:chararray,c3:chararray,c4:int,c5:chararray);
STORE A INTO 'hbase://mydata'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'mycf:c1,mycf:c2,mycf:c3,mycf:c4,mycf:c5');
执行脚本后显示
2014-04-29 16:01:06,367 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - 100% complete
2014-04-29 16:01:06,376 [main] ERROR org.apache.pig.tools.pigstats.PigStatsUtil - 1 map reduce job(s) failed!
2014-04-29 16:01:06,382 [main] INFO org.apache.pig.tools.pigstats.SimplePigStats - Script Statistics:
HadoopVersion PigVersion UserId StartedAt FinishedAt Features
1.1.1 0.12.0 hduser 2014-04-29 15:58:07 2014-04-29 16:01:06 UNKNOWN
Failed!
Failed Jobs:
JobId Alias Feature Message Outputs
job_201403142119_0084 A MAP_ONLY Message: Job failed! Error - JobCleanup Task Failure, Task: task_201403142119_0084_m_000001 hbase://mydata,
Input(s):
Failed to read data from "/user/hduser/Dataparse/goodrec1.txt"
Output(s):
Failed to produce result in "hbase://mydata"
Counters:
Total records written : 0
Total bytes written : 0
Spillable Memory Manager spill count : 0
Total bags proactively spilled: 0
Total records proactively spilled: 0
Job DAG:
job_201403142119_0084
2014-04-29 16:01:06,382 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Failed!
请帮忙看看我哪里出错了?
【问题讨论】:
-
hadoop fs -ls /user/hduser/Dataparse/file.txt 显示什么??
-
file.txt 是逗号分隔值的文本文件,其内容为:15,,CO,5656,F 20,George11,MI,5555,M 1,8888a,FL,5899,F
-
我不是在询问文件的内容。我只想要 hadoop fs -ls /user/hduser/Dataparse/goodrec1.txt 的输出。请连同命令一起复制确切的输出。
-
hadoop fs -cat /user/hduser/Dataparse/goodrec1.txt
15,,CO,5656,F 20,George11,MI,5555,M 1,8888a,FL,5899,F -
您能提供在
hbase shell中运行的list命令的结果吗?
标签: hadoop hbase apache-pig bigdata