소스 검색

HUE-8036 [hive] Properly log invalid query handle to be less confusing

Romain Rigaux 7 년 전
부모
커밋
fc01dcc
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      apps/beeswax/src/beeswax/server/hive_server2_lib.py

+ 8 - 3
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -974,10 +974,15 @@ class HiveServerClient:
       req = TGetLogReq(operationHandle=operation_handle)
       res = self.call(self._client.GetLog, req)
       return res.log
-    except:
-      LOG.exception('server does not support GetLog')
+    except Exception, e:
+      if 'Invalid query handle' in str(e):
+        message = 'Invalid query handle'
+        LOG.error('%s: %s' % (message, e))
+      else:
+        message = 'Error when fetching the logs of the operation.'
+        LOG.exception(message)
 
-      return 'Server does not support GetLog()'
+      return message
 
 
   def get_partitions(self, database, table_name, partition_spec=None, max_parts=None, reverse_sort=True):