Skip to content

Add support for terminating running queries on Trino when dbt command is canceled #474

@okayhooni

Description

@okayhooni

Describe the feature

Problem Statement:

When executing queries on Trino via dbt, if the dbt command is canceled (e.g., via Ctrl+C or process termination), the corresponding query continues running on the Trino cluster. This can lead to unnecessary resource consumption and potential performance degradation.

Expected Behavior:

When a dbt command is terminated, it should also ensure that the corresponding query on Trino is canceled.

Proposed Solution:

Modify the dbt-trino adapter to explicitly call system.runtime.kill_query(query_id) on Trino when the dbt process is interrupted.

Describe alternatives you've considered

No response

Who will benefit?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions