|
|
@@ -231,7 +231,10 @@ class HS2Api(Api):
|
|
|
status = HiveServerQueryHistory.STATE_MAP[operation.operationState]
|
|
|
|
|
|
if status.index in (QueryHistory.STATE.failed.index, QueryHistory.STATE.expired.index):
|
|
|
- raise QueryError(operation.errorMessage)
|
|
|
+ if 'transition from CANCELED to ERROR' in operation.errorMessage: # Hive case on canceled query
|
|
|
+ raise QueryExpired()
|
|
|
+ else:
|
|
|
+ raise QueryError(operation.errorMessage)
|
|
|
|
|
|
response['status'] = 'running' if status.index in (QueryHistory.STATE.running.index, QueryHistory.STATE.submitted.index) else 'available'
|
|
|
|