Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-impala: stop using errors.get_exception_message #1224

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ def handle_error(
is_handled = self._handle_exception(current_exception, recovery_cursor)
break
except Exception as new_exception:
self._log.warning(
"Failed to handle exception due to: "
+ errors.get_exception_message(new_exception)
)
self._log.warning(f"Failed to handle exception due to: {new_exception}")
current_exception = new_exception
# Throw the latest exception only if different from the initial exception.
if not is_handled and (
Expand Down Expand Up @@ -137,7 +134,7 @@ def _handle_hdfs_failed_to_open_file_error(
):
regex = ".*/user/hive/warehouse/([^/]*).db/([^/]*)"
matcher = re.compile(pattern=regex, flags=re.DOTALL)
results = matcher.search(errors.get_exception_message(exception))
results = matcher.search(str(exception).strip())
self._log.info(
"Detected query failing with Failed to find file error. WIll try to autorecover."
)
Expand Down Expand Up @@ -168,7 +165,7 @@ def _handle_hdfs_failed_to_open_file_error(
return True
else:
self._log.info(
f"Cannot auto-recover as it cannot detect table name in error: {errors.get_exception_message(exception)}"
f"Cannot auto-recover as it cannot detect table name in error: {exception}"
)
return False

Expand Down Expand Up @@ -297,7 +294,7 @@ def _handle_metadata_exception_with_invalidate_and_backoff(

# Get the fully qualified table name from the exception message.
matcher = re.compile(pattern=pattern_for_the_table_name)
results = matcher.search(errors.get_exception_message(exception))
results = matcher.search(str(exception).strip())
if results and len(results.groups()) == 1:
fully_qualified_table_name = results.group(1)
# invalidate the metadata for the missing table
Expand Down Expand Up @@ -348,9 +345,7 @@ def get_fully_qualified_table_name(exception_to_match: Exception):
if pattern_for_the_table_name:
# Get the fully qualified table name from the exception message.
matcher = re.compile(pattern=pattern_for_the_table_name)
results = matcher.search(
errors.get_exception_message(exception_to_match)
)
results = matcher.search(str(exception_to_match).strip())
if results and len(results.groups()) == 1:
fully_qualified_table_name = results.group(1)

Expand Down