I am trying to get the size of a file from hdfs using python 3.5 and hdfs library.
https://pypi.python.org/pypi/hdfs/
from hdfs.client import Client
if __name__ == '__main__':
cl = Client("http://hostName:50070")
print (cl.content("/path/to/file/fileName.txt",False))
i get
{'spaceQuota': -1, 'directoryCount': 0, 'spaceConsumed': 103566, 'length': 34522, 'quota': -1, 'fileCount': 1}
so as per this message, the file size is 103 KB
but when i look at http://hostName:50070/explorer.html#/path/to/file/
i see that the file size is 33.71 KB
! How is this possible? Is there another way to get the proper size for a file in hdfs? How about the size of a directory?