Member since
09-04-2019
1
Post
0
Kudos Received
0
Solutions
10-07-2021
04:06 AM
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")
... View more
Labels:
- Labels:
-
Apache Hive