'Replace value of a key in Hdfs file using Hadoop command

I want to replace text of one file with another values in hdfs file I have one file and its contain below context.

v1
{"batchWatermarkMs":0,"batchTimestampMs":1644409052449,"conf": {"spark.sql.shuffle.partitions":"200"}}
{"Spark_Offset_Value_Change":{"2":12,"1":12,"0":10}}

now I want to replace the value which comes after "Spark_Offset_Value_Change":{ with the desired value which i want to pass from command.

"2":12,"1":12,"0":10 

this value is not fixed in source and it can be any value(integer).

example: let say i want to replace "2":12,"1":12,"0":10 this value by "2":20,"1":20,"0":20

so the updated file will looks like :

v1
{"batchWatermarkMs":0,"batchTimestampMs":1644409052449,"conf": 
{"spark.sql.shuffle.partitions":"200"}}
{"Spark_Offset_Value_Change":{"2":20,"1":20,"0":20}}

Kindly suggest how can I replace this value using Hadoop command.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source