Command to remove map reduce output through command line

Discussion in 'General Discussions' started by Nikhil_974, Sep 15, 2018.

  1. Nikhil_974

    Nikhil_974 Member

    Joined:
    Jul 28, 2018
    Messages:
    3
    Likes Received:
    0
    Hi guys,

    Can anyone tell me how do I remove the map reduce output through command line.

    The command I have used is

    hdfs dfs -rm -r out/part-r-00000

    I am getting an error No such file or directory

    Regards,
    Nikhil
     
    #1
  2. ruhi.jain

    ruhi.jain Well-Known Member
    Simplilearn Support

    Joined:
    Jun 7, 2018
    Messages:
    93
    Likes Received:
    0
    Hi Nikhil,

    Thank you for reaching out to us.

    I would just like to know if you want to get the output through map reduce format?
    Or so you want to display the out in a particular format.

    Awaiting your response.

    Regards,
    Ruhi Jain
    Global Teaching Assistant
     
    #2
  3. Nikhil_974

    Nikhil_974 Member

    Joined:
    Jul 28, 2018
    Messages:
    3
    Likes Received:
    0
    Hey Ruhi i am actually trying to remove the output through the map reduce java program itself but i am getting an error on compilation. The error is due to the below two statements

    FileSystem fs=FileSystem.get(conf);
    fs.delete(new Path(args[1]));

    I am able to remove the output file through command line using the rmr command but need know why the above statement is failing.

    And sorry for delay in replying
     
    #3
  4. Shalini Rana

    Shalini Rana Well-Known Member
    Simplilearn Support

    Joined:
    Jul 24, 2017
    Messages:
    307
    Likes Received:
    16
    Hi Nikhil,

    Can you please share the screenshot of the entire program that you are implementing to remove the file.

    Thanks!
     
    #4
  5. Nikhil_974

    Nikhil_974 Member

    Joined:
    Jul 28, 2018
    Messages:
    3
    Likes Received:
    0
    Hi Shalini,

    Kindly find the attached screenshot for the same.

    Thanks
     

    Attached Files:

    #5
  6. ruhi.jain

    ruhi.jain Well-Known Member
    Simplilearn Support

    Joined:
    Jun 7, 2018
    Messages:
    93
    Likes Received:
    0
    Hi,

    In the command: fs.delete(new Path(args[1])); there is an argument missing.
    The correct syntax is:
    fs.delete(new Path(args[1]),true);

    Please let me know in case of any further queries.
     
    #6

Share This Page