Git Product home page Git Product logo

Comments (4)

henrywu2019 avatar henrywu2019 commented on August 25, 2024 1

Huge thanks, @lab176. The pseudo commands could be used to support Asynchronous Query you described above: https://github.com/uber/athenadriver#pseudo-commands Please refer to the sample code in the README and let me know if there is any issue/question.

from athenadriver.

henrywu2019 avatar henrywu2019 commented on August 25, 2024

Thank @lab176 for the great question.

You can refer to https://github.com/uber/athenadriver/blob/master/examples/querycancel.go for how a query can be canceled in database/sql framework. The poll for query completion has been handled by athenadriver so you don't have to write the code yourself. You can just pass the cancel function to the other goroutine/thread and cancel the query there.

from athenadriver.

lab176 avatar lab176 commented on August 25, 2024

Hi @henrywu2019 ,

Thanks for the response!
I need to clarify our use case, as you have provided a solution for what I asked but what I asked was insufficient.
Spinning up a go routine and cancelling the request via context is insufficient for our use case.
We have an app that will send an http request to an intermediate component, called query-gateway, that handles requests to Athena by leveraging this athenadriver. Because we often observe Athena query times of a few minutes, we'd like to request query-gateway to initiate the Athena query then simply return to the app, and enable the app to poll any query-gateway instance for that query's completion + results. This saves us from having to maintain a connection to a single query-gateway instance for the length of the Athena query or, alternatively, maintain state.
Ideally, this could be an interface containing the following: a function that will kick off a query and return an object containing QueryExecutionId, another function that may use that object to poll for query completion, and another for cancelling that query, etc.

from athenadriver.

lab176 avatar lab176 commented on August 25, 2024

@henrywu2019 Amazing turnaround! Thank you!

from athenadriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.