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

Can't schedule parameterized queries against the Query Results data source #4519

Closed
susodapop opened this issue Jan 2, 2020 · 2 comments
Closed

Comments

@susodapop
Copy link
Contributor

Issue Summary

Redash allows scheduling queries even if they include parameters. But scheduling a parameterized query against the QRDS always fails. The issue must be the parameters. Because if I remove the parameters then the whole thing works.

Steps to Reproduce

1. Create a simple, filterable query

SELECT 'bar' "foo";

2. Use Query Results with a parameter

SELECT datetime('now') "stamp", "foo" from query_xxxx WHERE "foo" = {{ param }}

query_xxxx points to the query from step one. param can be a dropdown list, text, or query based dropdown list type. No matter how you do it, set the parameter equal to a string literal: bar. Observe that the query returns proper data

Stamp Bar
2020-01-01 22:00 foo

I faked the date for this example.

3. Set a query refresh schedule

Here I'll use a one minute interval. What we would expect is that after one minute, the query should be executed by the scheduler and will return data like this:

Stamp Bar
2020-01-01 22:05 foo

We'd also expect the Redash UI to indicate the query was reflected at 22:05 (or whatever the associated server time was at execution time). But it doesn't. It still shows 22:00. No matter how long you wait.

4. Remove the parameter from the QRDS query

SELECT datetime('now') "stamp", "foo" from query_xxxx WHERE "foo" = 'bar'

Perform the same test from step three. Observe that the query updates as expected.

Technical details:

  • Redash Version: v9 Alpha
  • Browser/OS: FF / Safari / Chrome
  • How did you install Redash: SaaS
@susodapop
Copy link
Contributor Author

Having checked with @gabrieldutra this is a duplicate of #4182

@arikfr
Copy link
Member

arikfr commented Jan 3, 2020

It has nothing to do with the Query Results data source. It's just the use of parameters (reproduced here: https://redash-preview.netlify.com/queries/299/source?p_param=foo).

As we have an open issue for the general case, I'm closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants