Created on 10-07-2021 04:06 AM - edited 10-07-2021 04:10 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")
Created 10-10-2021 11:42 PM
Was the below query working in hs2 beeline ?
'select cola, null as colb, "x" as colc from mytable'
Can you share the show create table output.
show create table <tablename>;
Created 10-17-2021 11:35 PM
@Geenspruitjes, Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. If you are still experiencing the issue, can you provide the information @balajip has requested?
Regards,
Vidya Sargur,