vdk-impala: handle decorate operation errors #2975
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
Due to logic in vdk-core, the managed cursor tries to execute all implementations of the db_connection_decoreate_operation hook. This happens even if it's not the correct cursor, e.g. an oracle cursor might try to execute impala queries. This case is handled in other plugins by wrapping the decorator in a try/catch block. However, the job should fail if the default db type is impala and the actual error is an impala error and not coming from some other cursor.
What?
Check the db_default_type config if an exception occurs in the decorator. If the db_default type is not impala, output an error log. If the db_default type is impala, re-throw the error
How was this tested?
Tested locally
CI
What kind of change is this?
Bugfix
Follow-up
#2973