-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Postagg Theta Sketch Bug #2736
Comments
This first needs pydruid to be updated to support theta sketches (druid-io/pydruid#72) and then support can be added in superset. |
@joshwalters workaround until the fix is to include the aggregation required for the post aggregation as one of the metrics. |
@kkalyan Yes, that does work. It messes up the charts a bit (as we get a metric we don't want), but it does enable the post-agg to process. |
Yes that's a bug as far as I'm concerned and needs to be improved. |
Just reviewed the code, @RichRadics fix (druid-io/pydruid#72) is needed to correct this issue in Superset. Once that is merged in, adding the fix to Superset should be a ~4 line change. If anyone is interested in seeing this fix, please comment in druid-io/pydruid#72 |
Notice: this issue has been closed because it has been inactive for 335 days. Feel free to comment and request for this issue to be reopened. |
Superset version
0.17.4
Expected results
Using a Theta sketch in a post agg should be valid, as it works for HyperUnique columns.
For example, if I have a
longSum
columnA
and a Theta sketch columnB
, I should be able to have apostagg
metric that dividesA
byB
.A simple example JSON Druid query generated from a table view slice in Superset should generate a query like this:
Actual results
Using a Theta sketch in a
postagg
fails with aHTTP Error 500: Internal Server Error Druid Error: Unknown
failure. This happens because the JSON query generated by Superset is invalid, it does not include the Theta sketch column in theaggregations
field.Here is the generated query (note that the Theta sketch column is missing in
aggregations
):I believe the error is in this file: https://github.com/airbnb/superset/blob/master/superset/connectors/druid/models.py
It uses
hyperUniqueCardinality
but notthetaSketchEstimate
.Steps to reproduce
Have a Druid cluster with a Theta sketch column.
Add a postagg to divide some metric by the Theta sketch metric.
In the
Edit Druid Datasource
, you can create a new metric. Usingpostagg
as the metric you can set the JSON as follows:Use a Table View slice on this new metric, and you will see a
HTTP 500
error.Issue discovered and investigated by: @jgodlew @ananthanithya
The text was updated successfully, but these errors were encountered: