Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def connhive(self,database='fkdb',auth='LDAP'):
conn = hive.Connection(host=self.host, port=self.port, username=self.user, auth=self.auth, password=self.pwd,
database=self.database)
logger.info(msg="hive server connect sucessfully {hivehost:%s,hiveport:%d,hiveuser:%s,hivepwd:%s,hiveauth:%s,hivedatabase:%s}"%(
self.host,self.port,self.user,self.pwd,self.auth,self.database
))
return conn
def _connection(self):
if not self._conn:
self._conn = hive.Connection(
host=self.host, port=self.port, auth=self.auth, kerberos_service_name=self.service_name)
return self._conn
def connect(*args, **kwargs):
"""Constructor for creating a connection to the database. See class :py:class:`Connection` for
arguments.
:returns: a :py:class:`Connection` object.
"""
return Connection(*args, **kwargs)