I am trying to connect Hive DB using below host and user creds. Getting error "UnicodeError: label too long". Is there a way I can overcome this issue?
I tried below script:
from pyhive import hive
import re, os, time
import pandas as pd
import sys
import thrift_sasl
import pysasl
import thrift
host_name = "hs2-odt-uk-ert-yt-rtye.uiy-asdfr.dw.dkrt-
ty78.cloudera.site/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3"
port = 10000
user = "dk12345"
password = "password"
database = "prd"
def hiveconnection(host_name, port, user, database):
conn = hive.Connection(host=host_name,port=port,username=user, database=database,
auth='NOSASL')
cur = conn.cursor()
cur.execute('SELECT * FROM schema.ad')
result = cur.fetchall()
return result
output = hiveconnection(host_name, port, user, database)
print(output)