Proper error handling in Hive Queries (#4428)

* Proper error handling in Hive Queries

* Change quotes

* Trigger checks

* Adding call to parent class

* Small fix

* Fix in method call
This commit is contained in:
Maciej Bryński 2018-05-29 21:42:45 +02:00 committed by Maxime Beauchemin
parent 459267785f
commit ae50845843
1 changed files with 8 additions and 0 deletions

View File

@ -931,6 +931,14 @@ class HiveEngineSpec(PrestoEngineSpec):
return BaseEngineSpec.fetch_result_sets(
db, datasource_type, force=force)
@classmethod
def fetch_data(cls, cursor, limit):
from TCLIService import ttypes
state = cursor.poll()
if state.operationState == ttypes.TOperationState.ERROR_STATE:
raise Exception('Query error', state.errorMessage)
return super(HiveEngineSpec, cls).fetch_data(cursor, limit)
@staticmethod
def create_table_from_csv(form, table):
"""Uploads a csv file and creates a superset datasource in Hive."""