Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ cover/
.cache/
*.iml
/scripts/.thrift_gen
build/
2 changes: 2 additions & 0 deletions pyhive/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def __init__(
ssl_cert=None,
thrift_transport=None,
timeout=None,
query_timeout=None,
thrift_keepalive=False
):
"""Connect to HiveServer2
Expand Down Expand Up @@ -282,6 +283,7 @@ def __init__(
self._sessionHandle = response.sessionHandle
assert response.serverProtocolVersion == protocol_version, \
"Unable to handle protocol version {}".format(response.serverProtocolVersion)
socket.setTimeout(query_timeout)
with contextlib.closing(self.cursor()) as cursor:
cursor.execute('USE `{}`'.format(database))
except:
Expand Down