I'm using subprocess to run hive commands in python, but am getting empty results. If i run the same commands from hive CLI, am getting results.
query = "set hive.cli.print.header=true;use mydb;describe table1;"
process = subprocess.Popen( ["ssh", "hadoop" , "hive", "-e", "%r" % query], stdout = subprocess.PIPE, stderr = subprocess.PIPE )
data = [line.split('\t') for line in process.stdout]
cols = list(itertools.chain.from_iterable(data[:1]))
df = pd.DataFrame(data[1:], columns = cols)
print "==>"+df+"<----"
It's returning empty dataframe.
Please help me with this