python - How to compare hdfs file with unix file? -
I want to compare the HDFS file with the Unix file. I know that using the cat command in the same way we can compare the files because the cat command is provided by the Hadoop Distributed File System (HDFS).
Let's take an example:
# hdfs dfs -ls -r / demo-rw-r-r-- 3 root hdfs 129617 2014-10-17 12 : 22 /demo/abc.log #l / tmp xyz.log
I want to compare abc.log here. Code> to
xyz.log
. Any better approach ??
You can probably use shell redirection + diff
diff & lt; (Hdfs dfs -cat / demo / abc.log) & lt; (Cat /tmp/xyz.log)
Comments
Post a Comment