Skip to content

Commit

Permalink
Only install PyHive for default HiveServer2Client driver
Browse files Browse the repository at this point in the history
  • Loading branch information
naoyak committed Sep 8, 2018
1 parent 49f7073 commit 6945b0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion omniduct/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

'hiveserver2': [
'pyhive[hive]>=0.4', # Primary client
'impyla>=0.14.0', # Primary client
'thrift>=0.10.0', # Thrift dependency which seems not to be installed with upstream deps
],

Expand Down
5 changes: 4 additions & 1 deletion omniduct/databases/hiveserver2.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def _connect(self):
self._sqlalchemy_engine = create_engine('hive://{}:{}/{}'.format(self.host, self.port, self.schema))
self._sqlalchemy_metadata = MetaData(self._sqlalchemy_engine)
elif self.driver == 'impyla':
import impala.dbapi
try:
import impala.dbapi
except ModuleNotFoundError:
raise ImportError("Please install impyla or specify driver='pyhive'.")
self.__hive = impala.dbapi.connect(host=self.host,
port=self.port,
auth_mechanism=self.auth_mechanism,
Expand Down

0 comments on commit 6945b0a

Please sign in to comment.