Comments (4)
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.
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.
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.
@henrywu2019 Amazing turnaround! Thank you!
from athenadriver.
Related Issues (20)
- Athenareader output prettified
- Query by QID not working in Athenareader
- Client side cache
- `$path` is not supported HOT 2
- Vv
- SQL go to QID branch when query has uuid-type string in it
- Need to support multi type credentials such as STS credentials
- Serialization problems HOT 8
- Expose DriverTracer factory methods
- Authentication problem with Lambda function HOT 7
- Missing example for `get_cost` pseudo command HOT 1
- Allow connector to create an AWS session with default credentials HOT 3
- Override athena endpoint HOT 2
- ResultReuse Support HOT 1
- Allow returning nil for missing values HOT 1
- When calling from go routing, getting DATA RACE HOT 1
- Is there a way to override the constant PoolInterval HOT 2
- aws-sdk-go-v2 support
- results bucket with folders add an empty folder at room HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from athenadriver.