Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyhive/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def __init__(
password=None,
check_hostname=None,
ssl_cert=None,
thrift_transport=None
thrift_transport=None,
timeout=None
):
"""Connect to HiveServer2

Expand Down Expand Up @@ -152,6 +153,7 @@ def __init__(
),
ssl_context=ssl_context,
)
thrift_transport.setTimeout(timeout)

if auth in ("BASIC", "NOSASL", "NONE", None):
# Always needs the Authorization header
Expand Down Expand Up @@ -195,6 +197,7 @@ def __init__(
if auth is None:
auth = 'NONE'
socket = thrift.transport.TSocket.TSocket(host, port)
socket.setTimeout(timeout)
if auth == 'NOSASL':
# NOSASL corresponds to hive.server2.authentication=NOSASL in hive-site.xml
self._transport = thrift.transport.TTransport.TBufferedTransport(socket)
Expand Down