0

如何将hdfs中的mapreduce程序的输出数据加载到hbase中?

我尝试运行以下 pig 命令将数据从 hdfs 加载到 hbase:-

A = LOAD 'hdfs://b**/user/user1/development/hbase/output/part-00000' USING PigStorage('t') as (strdata1:chararray, strdata2:chararray); 
STORE A INTO 'hbase://mydata' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('mycf:strdata2');

其中,hdfs://b**/user/user1/development/hbase/output/part-00000是 map-reduce 输出mydata是创建的 hbase 表名称 mycf是列族名称

我收到以下错误:-

ERROR 2017: Internal error creating job configuration.

org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException: ERROR 2017: Internal error creating job configuration. 
  at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:673) 
  at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:256) 
  at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:147) 
  at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.execute(HExecutionEngine.java:378) 
  at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1198) 
  at org.apache.pig.PigServer.execute(PigServer.java:1190) 
  at org.apache.pig.PigServer.access$100(PigServer.java:128) 
  at org.apache.pig.PigServer$Graph.execute(PigServer.java:1517) 
  at org.apache.pig.PigServer.executeBatchEx(PigServer.java:362) 
  at org.apache.pig.PigServer.executeBatch(PigServer.java:329) 
  at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:112) 
  at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:169) 
  at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:141) 
  at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:90) 
  at org.apache.pig.Main.run(Main.java:406) 
  at org.apache.pig.Main.main(Main.java:107)
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: hbase://mydata_logs at org.apache.hadoop.fs.Path.initialize(Path.java:148) 
  at org.apache.hadoop.fs.Path.<init>(Path.java:71) 
  at org.apache.hadoop.fs.Path.<init>(Path.java:45) 
  at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:476) 
  ... 15 more
Caused by: java.net.URISyntaxException: Relative path in absolute URI: hbase://mydata_logs at java.net.URI.checkPath(URI.java:1787) 
  at java.net.URI.<init>(URI.java:735)
  at org.apache.hadoop.fs.Path.initialize(Path.java:145)
4

1 回答 1

1

仅从数据源字符串中删除 hbase:// 模式,如下所示: STORE A INTO 'mydata' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('mycf:strdata2');

于 2013-03-11T09:18:57.160 回答