1) Using PIG command I wrote the the output to a file in the hdfs . How can i copy the file in the hdfs location to the local folder. I can see the file using the command  hadoop fs -ls hdfs://

** copytolocal and put command doesn't work

To copy file from hdfs to local file system, you have to use copyToLocal command.Please check below screen shots.

hdfs dfs -ls /

Now execute copyToLocal command as shown below:

2) Pig command to write the variable output to a local folder instead of hdfs location.

As far as I know, we cannot achieve this. We can save the output only to hdfs using STORE command.

If you want to view the intermediate result, DUMP is the best option to go with.

Please note if you are not happy with the response on this ticket, please escalate it to escalations@edureka.in.

We assure you that we will get back to you within 24 hours



Sumit Anand

edureka! Solution Team

Website - www.edureka.co

Edureka claims 1st position at Deloitte's Technology Fast 50 India 2014