def get_query_id(self, sql): ips = self.docker_cluster.get_ip_address_dict() client = PrestoClient(ips[self.docker_cluster.master], 'root', 8080) run_sql(client, sql) query_runtime_info = run_sql(client, 'SELECT query_id FROM ' 'system.runtime.queries ' 'WHERE query = \'' + sql + '\'') for row in query_runtime_info: return row[0]
def get_query_id(self, sql): ips = self.cluster.get_ip_address_dict() client = PrestoClient(ips[self.cluster.master], 'root', 8080) run_sql(client, sql) query_runtime_info = run_sql(client, 'SELECT query_id FROM ' 'system.runtime.queries ' 'WHERE query = \'' + sql + '\'') if not query_runtime_info: raise PrestoError('Presto not started up yet.') for row in query_runtime_info: return row[0]
def get_query_id(self, sql, host=None): ips = self.cluster.get_ip_address_dict() if host is None: host = self.cluster.master client = PrestoClient(ips[host], 'root') run_sql(client, sql) query_runtime_info = run_sql(client, 'SELECT query_id FROM ' 'system.runtime.queries ' 'WHERE query = \'' + sql + '\'') if not query_runtime_info: raise PrestoError('Presto not started up yet.') for row in query_runtime_info: return row[0]