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

fix(sqllab): Force trino client async execution #24859

Merged
merged 1 commit into from
Sep 6, 2023

Commits on Aug 2, 2023

  1. fix(sqllab): Force trino client async execution

    We are currently unable to stop trino queries, because the underlying
    trino client blocks until the query completes, and doesn't make the
    query ID or any other info available in the meantime. Unfortunately it
    doesn't look like they plan to change that any time soon, either.
    
    Make the following changes:
      - Add a new method execute_with_cursor to db_engine_spec which
        combines execute with handle_cursor, factoring it out of the one
        place it's used, deep in the execute query logic.
      - Make handle_cursor poll the cursor for query ID, as it's going to
        be populated asynchronously. Add warnings that the trino impl will
        require using execute_with_cursor. Currently nothing is directly
        calling handle_cursor, with the one original call eliminated.
      - Override execute_with_cursor for the trino engine and execute the
        two tasks in parallel to allow us to poll for the query ID
        while the query is still blocking.
    giftig committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    4919b58 View commit details
    Browse the repository at this point in the history