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

Superset Solr setup does not support time-interval GROUP BY aggregations #1

Open
anjackson opened this issue Jan 29, 2021 · 0 comments

Comments

@anjackson
Copy link
Contributor

anjackson commented Jan 29, 2021

The main limitation is that Superset expects to be able to issue queries that aggregate by truncated values of dates, i.e. GROUP BY timestamp_dt/DAY. However, Solr SQL GROUP BY only supports field values at the moment.

If Solr supported this, then building on the initial Superset support for Solr it would be possible to add time grain expression like:

    _time_grain_expressions = {
        None: "{col}",
        "P1D": "{col}/DAY"
    }

Example query using this template:

w3act_superset.1.qm6cy21xfafp@dev1    | SELECT count(timestamp_dt/DAY) AS __timestamp,
w3act_superset.1.qm6cy21xfafp@dev1    |        COUNT(*) AS `count`
w3act_superset.1.qm6cy21xfafp@dev1    | FROM tracking
w3act_superset.1.qm6cy21xfafp@dev1    | WHERE TRUE
w3act_superset.1.qm6cy21xfafp@dev1    |   AND timestamp_dt = '[2021-01-22T00:00:00Z TO 2021-01-29T00:00:00Z}'
w3act_superset.1.qm6cy21xfafp@dev1    | GROUP BY timestamp_dt/DAY
w3act_superset.1.qm6cy21xfafp@dev1    | LIMIT 10000

Apart from that, running under Docker worked file, although some database setup or migration is needed, as per https://github.com/apache/superset/blob/1.0.0/docker/docker-init.sh etc. And REMOTE USER setup is possible too https://github.com/ajgil/Superset-remote-user-auth-nginx

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

1 participant