Ejemplo n.º 1
0
 def open_session(self, user, configuration=None):
     protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6
     req = TOpenSessionReq(client_protocol=protocol,
                           username=user,
                           configuration=configuration)
     resp = self._rpc('OpenSession', req)
     return HS2Session(self, resp.sessionHandle, resp.configuration,
                       resp.serverProtocolVersion)
Ejemplo n.º 2
0
def open_session(service, user, configuration=None):
    req = TOpenSessionReq(
        client_protocol=TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6,
        username=user,
        configuration=configuration)
    log.debug('open_session: req=%s', req)
    resp = service.OpenSession(req)
    log.debug('open_session: resp=%s', resp)
    err_if_rpc_not_ok(resp)
    return (resp.sessionHandle, resp.configuration, resp.serverProtocolVersion)