def get_databases(self, schemaName=None): # GetCatalogs() is not implemented in HS2 req = TGetSchemasReq() if schemaName is not None: req.schemaName = schemaName if self.query_server['server_name'] == 'impala': req.schemaName = None res = self.call(self._client.GetSchemas, req) results, schema = self.fetch_result(res.operationHandle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=5000) self.close_operation(res.operationHandle) col = 'TABLE_SCHEM' return HiveServerTRowSet(results.results, schema.schema).cols((col,))
def get_databases(self, schemaName=None): # GetCatalogs() is not implemented in HS2 req = TGetSchemasReq() if schemaName is not None: req.schemaName = schemaName if self.query_server['server_name'] == 'impala': req.schemaName = None res = self.call(self._client.GetSchemas, req) results, schema = self.fetch_result(res.operationHandle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=5000) self.close_operation(res.operationHandle) col = 'TABLE_SCHEM' return HiveServerTRowSet(results.results, schema.schema).cols((col,))
def getDatabases(self): req = TGetSchemasReq(self.session) res = self.client.GetSchemas(req) self.operationHandle = res.operationHandle if res.status.errorCode is not None: raise Pyhs2Exception(res.status.errorCode, res.status.errorMessage) return self.fetch()
def get_databases(self): # GetCatalogs() is not implemented in HS2 req = TGetSchemasReq() res = self.call(self._client.GetSchemas, req) results, schema = self.fetch_result(res.operationHandle) col = 'TABLE_SCHEM' return HiveServerTRowSet(results.results, schema.schema).cols((col, ))
def get_databases(self): # GetCatalogs() is not implemented in HS2 req = TGetSchemasReq() res = self.call(self._client.GetSchemas, req) results, schema = self.fetch_result(res.operationHandle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=5000) self.close_operation(res.operationHandle) col = 'TABLE_SCHEM' return HiveServerTRowSet(results.results, schema.schema).cols((col,))