How can I change data in HDFS?

0 votes
How can I change the data of a file that has been stored in hdfs?
Feb 18 in Big Data Hadoop by Karan
85 views

1 answer to this question.

0 votes

You can not modified data once stored in hdfs because hdfs follows Write Once Read Many model. You can only append the data once stored in hdfs.

answered Feb 18 by Rishi
We can only append the file which present on hdfs file system for this we follow this method

--to append a file in hdfs first we add the following property in hdfs-site.xml

<property>
  <name>dfs.support.append</name>
  <value>true</value>
  <description> HDFS allow append operation</description></property>

---use the following command for the append operation

hdfs dfs -appendToFile <local_file> /<hdfs_file_name>

EXAMPLE--
----------

hdfs dfs -appendToFile raj /lok
Hey. Thanks for the answer. I have another doubt. Suppose I have stored a text file in hdfs. Now I want to append that file and add some more lines. How can I do this?
I have already mention in above comment full procedure follow that
I am a little confused. You mentioned that only append is allowed. So when we use the command you mentioned, are the contents of the <local_file> appended to <hdfs_file>?
At first you add the property in hdfs-site. xml
And after that you use the command

Related Questions In Big Data Hadoop

0 votes
1 answer

How can I append data to an existing file in HDFS?

You have to do some configurations as ...READ MORE

answered Jul 25 in Big Data Hadoop by ravikiran
• 4,560 points
438 views
0 votes
1 answer

How can I use my host machine’s web browser to check my HDFS services running in the VM?

The sole purpose of the virtual machine ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,300 points
151 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,300 points
91 views
0 votes
1 answer

How can you change a column data type in Hive?

Hi, By using this command below one can ...READ MORE

answered Jun 24 in Big Data Hadoop by Gitika
• 25,340 points
51 views
0 votes
1 answer

How can I download only hdfs and not hadoop?

No, you cannot download HDFS alone because ...READ MORE

answered Mar 15, 2018 in Big Data Hadoop by nitinrawat895
• 10,710 points
95 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,710 points
3,304 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,710 points
391 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
16,292 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
1,187 views
0 votes
1 answer

Edge nodes in Hadoop

Namenodes and Datanodes are a part of ...READ MORE

answered Feb 18 in Big Data Hadoop by Siri
412 views