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

/api/queries/{ID}/results.csv returns cached result #793

Closed
dangub opened this issue Jan 23, 2016 · 3 comments
Closed

/api/queries/{ID}/results.csv returns cached result #793

dangub opened this issue Jan 23, 2016 · 3 comments

Comments

@dangub
Copy link

dangub commented Jan 23, 2016

Repro steps:

  1. create query with params, e.g. name:

    select * from users where users.name= "{{name}}"

  2. save, and attempt to retrieve the query like so:

    /api/queries/{ID}/results.csv?p_name=foo&api_key=XXXXXXXX

  3. Then, change to p_name=bar.

  4. Check results

Results: results for foo
Expected: results for bar

Version: 0.8.1.b1110

@arikfr
Copy link
Member

arikfr commented Jan 24, 2016

Just to clarify, currently the backend doesn't support parameterized queries with the query results API. The way it works, is that the UI merges the params with the query and sends the backend the resulting query. This is why #285 is still open.

The tricky part in implementing this, is that query execution is async and when calling for query result, you might get a job id back that you need to poll until you get results. I might add support for that and leave for the API caller to implement polling.

For parameters support over API, subscribe to #285.

I will keep this open, to fix the behavior you indicated (it should probably return some error).

@arikfr arikfr added this to the v0.9.2 milestone Jan 24, 2016
@arikfr arikfr modified the milestone: v0.9.2 Feb 14, 2016
@arikfr arikfr added Backend and removed Frontend labels Feb 21, 2016
@arikfr arikfr added this to the v0.10.0 milestone Mar 8, 2016
@arikfr arikfr modified the milestones: v0.10.0, v0.10.1 Apr 18, 2016
@seigel
Copy link

seigel commented Jun 12, 2016

Alright. Ran into this last night. Glad it wasn't me.

On another tack, is there a way to purge the result from the query results table such that it goes back to the effect of "step 2" again?

@arikfr
Copy link
Member

arikfr commented Jun 14, 2016

In #1069 I fixed the wrong caching of semi-random results for parameterized queries and in #1116 I fixed the API call to return a meaningful error.

Closing this now. Support for parameters is already available in the POST /api/query_results API call and to know when GET /api/queries/<id>/results.json will support it track #285.

@arikfr arikfr closed this as completed Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants