user1326784
user1326784

Reputation: 657

Error When Loading Data from HDFS and Writing to HBase using Pig

How to load the output data of a mapreduce program which is in the hdfs into hbase?

I tried to running the following pig command to load the data from hdfs to 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');

where, hdfs://b**/user/user1/development/hbase/output/part-00000 is the map-reduce output mydata is the hbase table name created mycf is the column family name

I am getting the following error:-

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)

Upvotes: 0

Views: 2487

Answers (1)

user1728269
user1728269

Reputation: 11

Only remove the hbase:// schema from data source string like that : STORE A INTO 'mydata' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('mycf:strdata2');

Upvotes: 1

Related Questions