When running the query 'select cola, null as colb, "x" as colc from mytable' it gives the results:
cola, colb, colc
0001, None, None
None, None, None,
None, None, None
etc.
Using hivejdbc and python 3
Source:
#!/usr/bin/python3
import hivejdbc
from hivejdbc import connect, DictCursor
conn = connect(
host='$$$$$$.$$$$.$$$$',
port=10000,
driver='/PATH/hivejdbc42',
ssl=True,
trust_store='/truststore.jks',
trust_password='PASSWORD',
principal='hive/$$$$.$$$$.$$$$',
database='default',
)
try:
cur = conn.cursor()
cur.execute('select cola, null as colb, "x" as colc from mytable')
result = cur.fetchall()
print(result)
cur.close()
except:
print("Something went wrong!")
sys.exit("Error")