From 0380a86a49648df31fbfc0ced5335cf5918bd0cf Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 8 Dec 2022 17:44:42 +0800 Subject: [PATCH] feat: add sasl_maxbufsize param --- pyhive/hive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyhive/hive.py b/pyhive/hive.py index 3f71df33..a9573bf3 100644 --- a/pyhive/hive.py +++ b/pyhive/hive.py @@ -120,7 +120,8 @@ def __init__( password=None, check_hostname=None, ssl_cert=None, - thrift_transport=None + thrift_transport=None, + sasl_maxbufsize=None ): """Connect to HiveServer2 @@ -133,6 +134,7 @@ def __init__( :param password: Use with auth='LDAP' or auth='CUSTOM' only :param thrift_transport: A ``TTransportBase`` for custom advanced usage. Incompatible with host, port, auth, kerberos_service_name, and password. + :param sasl_maxbufsize: The maxbufsize attribute for sasl_client The way to support LDAP and GSSAPI is originated from cloudera/Impyla: https://github.com/cloudera/impyla/blob/255b07ed973d47a3395214ed92d35ec0615ebf62 @@ -222,6 +224,8 @@ def sasl_factory(): sasl_client.setAttr('password', password) else: raise AssertionError + if sasl_maxbufsize is not None: + sasl_client.setAttr('maxbufsize', sasl_maxbufsize) sasl_client.init() return sasl_client self._transport = thrift_sasl.TSaslClientTransport(sasl_factory, sasl_auth, socket)