MCPcopy Create free account
hub / github.com/apache/impala / _get_warn_or_error_log

Method _get_warn_or_error_log

shell/impala_shell/impala_client.py:1019–1045  ·  view source on GitHub ↗

Returns all messages from the error log prepended with 'WARNINGS:' or 'ERROR:' for last_query_handle, depending on whether warn is True or False. Note that the error log may contain messages that are not errors (e.g. warnings).

(self, last_query_handle, warn)

Source from the content-addressed store, hash-verified

1017 return query_handle.hasResultSet
1018
1019 def _get_warn_or_error_log(self, last_query_handle, warn):
1020 """Returns all messages from the error log prepended with 'WARNINGS:' or 'ERROR:' for
1021 last_query_handle, depending on whether warn is True or False. Note that the error
1022 log may contain messages that are not errors (e.g. warnings)."""
1023 try:
1024 self._set_current_query_handle(last_query_handle)
1025 if last_query_handle is None:
1026 return "Query could not be executed"
1027
1028 def GetLog(req):
1029 return self.imp_service.GetLog(req)
1030 # GetLog rpc is idempotent and so safe to retry.
1031 req = TGetLogReq(last_query_handle)
1032 resp = self._do_hs2_rpc(GetLog, req, retry_on_error=True)
1033 self._check_hs2_rpc_status(resp.status)
1034
1035 log = utf8_decode_if_needed(resp.log)
1036
1037 # Strip progress message out of HS2 log.
1038 log = HS2_LOG_PROGRESS_REGEX.sub("", log)
1039 if log and log.strip():
1040 log = self._append_retried_query_link(log)
1041 type_str = "WARNINGS" if warn is True else "ERROR"
1042 return "%s: %s" % (type_str, log)
1043 return ""
1044 finally:
1045 self._clear_current_query_handle()
1046
1047 def _do_hs2_rpc(self, rpc, rpc_input,
1048 suppress_error_on_cancel=True, retry_on_error=False):

Callers

nothing calls this directly

Calls 6

_do_hs2_rpcMethod · 0.95
_check_hs2_rpc_statusMethod · 0.95
utf8_decode_if_neededFunction · 0.85

Tested by

no test coverage detected