Created on
03-30-2020
11:35 AM
- last edited on
04-17-2020
06:16 AM
by
cjervis
I am currently using PyHive python package to connect to Hive. When using this package I am not able to provide HiveServer2 JDBC string as the host. I can only provide one host name.
jdbc:hive2://server1:2181,server2:2181,server3:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
Is there a way to connect to Hive from Python using the JDBC string? Does any other Python package allow that? Please provide samples.
Current code:
from pyhive import hive
hive_conn = hive.Connection(host=hive_host, configuration {'serviceDiscoveryMode':'zooKeeper','zooKeeperNamespace':'hiveserver2'})
Also tried using pyodbc but could not figure out the correct driver for Hortonworks Hadoop distribution.
Need a working code for Linux distribution