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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -