where exactly PIG stores its relations

陌路散爱 提交于 2019-12-12 01:25:13

问题


i am in a big confusion with the below two statements. 1) where exactly LOAD statement stores this relation(student), is it on hdfs/PIG internal storage/local machine ???

example : student = LOAD 'HDFS:/student' using PigStorage(',');

2) if i try to DUMP student; then it takes almost 30-40 sec to display result where as LOAD statement takes 1-2 sec.... if we are trying to retrieve data from pig internal storage then why is this delay ??

would be grateful if anyone can clear this doubts(preferably the flow of execution). thanks in adv.

my env: i am using VM for learning purpose.


回答1:


The LOAD does not store the data but it is just a pointer to the file. When LOAD statement is executed, no MapReduce task is executed.

It is only after the DUMP or STORE statement that a MapReduce job is initiated. We see our data in the output and we can confirm that the data has been loaded successfully.

DUMP take time as it disables multi-query execution and and slows down execution. (If you have included DUMP statements in your scripts for debugging purposes, you should remove them.)

If you want to store any data then can use the STORE command.



来源:https://stackoverflow.com/questions/36353195/where-exactly-pig-stores-its-relations

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!