티스토리 뷰

728x90
path=hdfs://a/b/c

hdfs dfs -test -e ${path}
if [ $? -eq 0 ]; then
    echo "exists !!!"
fi

hdfs dfs -test -z ${path}
if [ $? -eq 0 ]; then
    echo "zero !!!"
fi

size=`hdfs dfs -count ${path} | awk '{print $3}'`
echo $size

https://stackoverflow.com/questions/43900364/find-whether-file-exists-or-not-in-hdfs-using-shell-script/43903810

 

Find whether file exists or not in HDFS using shell script

I have a shell script like below. This script prints the path of a file located in HDFS #!/bin/bash TIMESTAMP=`date "+%Y-%m-%d"` path=/user/$USER/logs/${TIMESTAMP}.fail_log path1=/user/$USER/logs...

stackoverflow.com

https://stackoverflow.com/questions/8411180/hadoop-fs-lookup-for-block-size/65631223#65631223

 

Hadoop fs lookup for block size?

In Hadoop fs how to lookup the block size for a particular file? I was primarily interested in a command line, something like: hadoop fs ... hdfs://fs1.data/... But it looks like that does not e...

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Django] reverse query results (+ desc & limit)  (0) 2021.01.09
[Python] import modules of parent  (0) 2021.01.09
[Pyspark] show all results  (0) 2021.01.08
[Regexp] ignore case sensitivity  (0) 2021.01.08
[Java] remove line break `(\n|\r|\u0001)`  (0) 2021.01.08
댓글