Browse Source

HUE-3994 [editor] Canceled Hive queries stays as running in the history

Romain Rigaux 9 năm trước cách đây
mục cha
commit
dd38bb2

+ 4 - 1
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -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'