gpt4 book ai didi

hadoop - Pig 没有以 mapreduce 的心情运行(hadoop 3.1.1 + pig 0.17.0)

转载 作者:可可西里 更新时间:2023-11-01 14:30:12 25 4
gpt4 key购买 nike

我是 Hadoop 的新手。我的 hadoop 版本是 3.1.1,pig 版本是 0.17.0

在本地模式下运行此脚本,一切都按预期工作

pig -x local

grunt> student = LOAD '/home/ubuntu/sharif_data/student.txt' USING PigStorage(',') as ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );
grunt> DUMP student;

本地模式的结果 enter image description here

但对于相同的输入文件和 pig 脚本,mapreduce 模式无法成功运行。

pig -x mapreduce

grunt> student = LOAD '/pig_data/student.txt' USING PigStorage(',') AS ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );
grunt> STORE student INTO '/pig_data/student_out' USING PigStorage (',');

grunt> student = LOAD 'hdfs://NND1:9000/pig_data/student.txt' USING PigStorage(',') AS ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );
grunt> STORE student INTO 'hdfs://NND1:9000/pig_data/student_out' USING PigStorage (',');

mapreduce 模式的结果 enter image description here要么 enter image description here注意:student.txt 成功上传到HDFS。

hdfs dfs -ls  /pig_data 
Found 2 items
-rw-r--r-- 3 ubuntu supergroup 861585 2019-07-12 00:55 /pig_data/en.sahih.txt
-rw-r--r-- 3 ubuntu supergroup 234 2019-07-12 12:25 /pig_data/student.txt

即使在 grunt 下,此命令也会返回正确的 HDFS 文件名。

grunt> fs -cat /pig_data/student.txt 
  • 为什么里面有文件却提示读取数据失败小路?
  • 我遗漏的可能原因是什么?

感谢任何帮助。

最佳答案

部分问题是 Pig 0.17 还不支持 Hadoop 3。

Apache Pig Releases 0.17 的状态:

19 June, 2017: release 0.17.0 available

The highlights of this release is the introduction of Pig on Spark

Note:This release works with Hadoop 2.X (above 2.7.x)

和 JIRA PIG-5253 - Pig Hadoop 3 support仍在进行中。

关于hadoop - Pig 没有以 mapreduce 的心情运行(hadoop 3.1.1 + pig 0.17.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57002300/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com