Hi Apache Knox users,
         Working on Hive access through Knox. In CDP cloud it
advertises endpoint
"jdbc:hive2://mywackyserrver-manager0.pood-st.zc6q-kczr.cloudera.site/;ssl=true;transportMode=http;httpPath=mywackyserver/cdp-proxy-api/hive"
It would really nice if somebody has figure out how to use Knox Hive
endpoints to access Hive server 2 (http - which is what mine uses).
According to my theory this should work
```
import jaydebeapi

url="jdbc:hive2://mywackyserrver-manager0.pood-st.zc6q-kczr.cloudera.site:8443/default;user=wacky;password=wacky;ssl=true;sslTrustStore=/mytrustore;trustStorePassword=changeme;transportMode=http;httpPath=mywackyserver/cdp-proxy-api/hive"

#Connect to HiveServer2
# ..... classpath to to hadoop, hive client jars......

conn=jaydebeapi.connect("org.apache.hive.jdbc.HiveDriver", url)
cursor = conn.cursor()

# Execute SQL query
sql="show databases"
cursor.execute(sql)
results = cursor.fetchall()
print( results )
import jaydebeapi

url="jdbc:hive2://mywackyserrver-manager0.pood-st.zc6q-kczr.cloudera.site:8443/default;user=wacky;password=wacky;ssl=true;sslTrustStore=/mytrustore;trustStorePassword=changeme;transportMode=http;httpPath=mywackyserver/cdp-proxy-api/hive"

#Connect to HiveServer2
# ..... classpath to to hadoop, hive client jars......

conn=jaydebeapi.connect("org.apache.hive.jdbc.HiveDriver", url)
cursor = conn.cursor()

# Execute SQL query
sql="show databases"
cursor.execute(sql)
results = cursor.fetchall()
print( results )
```

Thanks,
                   Jeff Rodriguez

Reply via email to