Merge pull request #1753 from fbertsch/presto_cancellation

[Presto] Add: query cancellation support
This commit is contained in:
Arik Fraimovich 2017-05-04 23:21:59 +03:00 committed by GitHub
commit 22e3a4d8f2
2 changed files with 6 additions and 2 deletions

View File

@ -118,7 +118,11 @@ class Presto(BaseQueryRunner):
default_message = 'Unspecified DatabaseError: {0}'.format(db.message)
message = db.message.get('failureInfo', {'message', None}).get('message')
error = default_message if message is None else message
except Exception, ex:
except (KeyboardInterrupt, InterruptException) as e:
cursor.cancel()
error = "Query cancelled by user."
json_data = None
except Exception as ex:
json_data = None
error = ex.message
if not isinstance(error, basestring):

View File

@ -4,7 +4,7 @@ impyla==0.10.0
influxdb==2.7.1
MySQL-python==1.2.5
oauth2client==3.0.0
pyhive==0.1.6
pyhive==0.3.0
pymongo==3.2.1
pyOpenSSL==0.14
vertica-python==0.5.1