def connect(self, db_name=None, impalad=None): if not impalad: impalad = choice(self.impalads) conn = ImpalaConnection(host_name=impalad.host_name, port=impalad.hs2_port, user_name=self.cluster.hadoop_user_name, db_name=db_name, use_kerberos=self.cluster.is_kerberized) conn.cluster = self.cluster return conn