versatile-data-kit icon indicating copy to clipboard operation
versatile-data-kit copied to clipboard

Connection hook spec is not invoked with running queries through CLI

Open gageorgiev opened this issue 3 years ago • 0 comments

Describe the bug The connection hook spec - https://github.com/vmware/versatile-data-kit/blob/main/projects/vdk-core/src/vdk/api/plugin/connection_hook_spec.py - is not invoked when running queries through a CLI command like impala-query.

Steps To Reproduce Include the following code chunk in a plugin file (I used sqlite_plugin.py for testing):

@hookimpl
def db_connection_decorate_operation(decoration_cursor):
    op = decoration_cursor.get_managed_operation()
    op.set_operation("SELECT 2")

Then, install the plugin and run a data job with a SQL step. Observe that the query was replaced with 'SELECT 2'. Then, run a query using vdk sqlite-query and observe that the query has not been replaced.

Expected behavior The connection hook spec should be invoked both when running a data job as well as when running a single query.

Version (please complete the following information):

  • OS: MacOS 11.5
  • Version: latest

gageorgiev avatar Dec 06 '21 10:12 gageorgiev