0

I am following the simple piece of code from the documentation

http://hdfscli.readthedocs.org/en/latest/quickstart.html

with client.read(path, encoding='utf-8') as reader:
    print reader      
    from json import load
         model = load(reader)

the path is valid. i get

<requests.packages.urllib3.response.HTTPResponse object at 0x0000000003148048>

newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte

the first line is the result of print reader. Why am i getting this error? is there any other way to load json object from hdfs? I know that the object is JSON as thats how i had put it in. Is there a way to ignore the error? Why doesn't the encoding work?

AbtPst
  • 7,778
  • 17
  • 91
  • 172

0 Answers0