I am trying to write JSON content to HDFS location using Python,but for every key and value in my JSON content, I am seeing prefix of u and ''.
Original JSON content { "id": 2344556, "resource_type": "user", "ext_uid": null, "email": "Richard.John@abc.com", "name": "Rich John", "role": "manager", "role_id": 5944 }
import os
import json
import requests
from requests.auth import HTTPBasicAuth
users_url = "https://api.test.com/api/k1/users"
response = requests.get(users_url,auth = authParams)
users_json = response.json()
os.system(' echo "%s" | hadoop fs -put - hdfs://hadoopnode/user/uui123/API_JSON/user.json' %(users_json))
Output it's writing in hdfs location
{ u'id': u'2344556', u'resource_type': u'user', u'ext_uid': u'null', u'email': u'Richard.John@abc.com', u'name': u'Rich John', u'role': u'manager', u'role_id': u'5944' } How I can get my original content hdfs file without prefix u and ''