我尝试使用逗号分隔列表在Pig中加载AvroStorage的多个文件。我使用的陈述是:
test_data= LOAD 'repo_1/part-r-00000.avro,repo_2/part-r-00000.avro' USING org.apache.pig.piggybank.storage.avro.AvroStorage();
Pig声明在作业中没有指定输入路径。请参阅下面的堆栈跟踪。 我尝试了猪版本0.8.1-cdh3u2和0.9.1。
有没有人观察到同样的行为?这是一个错误还是一个功能?
堆栈跟踪:
rg.apache.pig.backend.executionengine.ExecException: ERROR 2118: No input paths specified in job
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:282)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:885)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:779)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:730)
at org.apache.hadoop.mapred.jobcontrol.Job.submit(Job.java:378)
at org.apache.hadoop.mapred.jobcontrol.JobControl.startReadyJobs(JobControl.java:247)
at org.apache.hadoop.mapred.jobcontrol.JobControl.run(JobControl.java:279)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: No input paths specified in job
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:186)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:241)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:270)
... 7 more
答案 0 :(得分:0)
这些部分文件由Pig自动加载,因此您只需指定目录。
尝试
test_file1 = LOAD 'repo_1' using AvroStorage();
test_file2 = LOAD 'repo_2' using AvroStorage();
test_file = UNION test_file1, test_file2;