Automating Hive with python -
i running hive 0.12, , i'd run several queries , result python array.
for example:
result=[] col in columns:   sql='select {c} cat,count(*) cnt {t} group {c} having cnt > 100;'.format(t=table,c=col)   result.append(hive.query(sql)) result=dict(result) what i'm missing, hive class run sql queries.
how can done ?
you access hive using thrift. https://cwiki.apache.org/confluence/display/hive/hiveclient#hiveclient-python. looks pyhs2 wrapper around using thrift directly.
Comments
Post a Comment