apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.87k stars 13.55k forks source link

Histogram do not support filter by metric #30330

Open vioao opened 3 days ago

vioao commented 3 days ago

Bug description

I get an error when using the filter by metric in the Histogram chart.

Apache Druid Error
'errorClass'

This may be triggered by:
Issue 1002 - The database returned an unexpected error. 

How to reproduce the bug

  1. build a histogram chart
  2. add a metric filter(having count(*))
  3. update the chart to get a view
  4. You will get an error

Screenshots/recordings

image

Superset version

4.0.2

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

dosubot[bot] commented 3 days ago

I found a similar unsolved discussion regarding an error when filtering a Druid query from the dashboard [1].

The known limitation of the Histogram chart in Superset is that cross filtering is not yet implemented [2].

In Superset version 4.0.2, there were fixes related to metric filtering and general filtering that might be relevant:

  1. Fix: Custom SQL filter control (#29260): This fix addresses issues with the custom SQL filter control, which could impact how metrics are filtered.
  2. Fix: filters not updating with force update when caching is enabled (#29291): This fix ensures that filters update correctly even when caching is enabled, which could affect metric filtering [3].

The specific SQL syntax or query configurations known to cause issues with Apache Druid in Superset are related to time grain expressions. Deviations from predefined expressions might cause issues [4][5].

For handling metric filters with Apache Druid, ensure that the pydruid package is installed and the connection string is correctly set up:

pip install pydruid

Connection string format:

druid://<User>:<password>@<Host>:<Port-default-9088>/druid/v2/sql

This setup allows Superset to handle Druid metrics and post-aggregations effectively [6].

To continue talking to Dosu, mention @dosu.