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

Is it possible to create a time-range dependent filter that populates additional (multiple) other filters? #24340

Closed
filpano opened this issue Jun 9, 2023 · 4 comments

Comments

@filpano
Copy link

filpano commented Jun 9, 2023

I have the situation where my dataset is partitioned in S3 based on date, in the format YYYY/MM/DD. My query backend is AWS Athena.

My data has the following noteworthy (for the purposes of this issue) columns:

  • creation_datetime (UTC ISO-8601 timestamp)
  • year (partition column)
  • month (partition column)
  • day (partition column)
  • other data columns

When querying data over Superset, I can add a time-range filter to most of my charts and dashboards. I can also, manually, add a filter for my partition columns (year, month, day).

If these partition columns are not explicitly given, then Athena does not submit the query using the 'expected' filtering leading to:

  • higher costs
  • longer runtime

due to it not actually using the available partition metadata.

It would be rather tedious for every single user to input these partitioning filters every time they wish to query a dataset, and it is error prone.

My time ranges have millisecond granularity, so it would not be feasible to partition on the time range itself. In fact, the partition metadata is derived from the time range at write-time.

Is it possible to create derived filters from the "time-range" filter, so that whenever the time-range filter is selected, custom filters (in this case year, month, day) populated from the selected time range are also set?

I attempted to do this for a dashboard, but I was unable to select the "Time Range" filter as a parent filter for the parent-child filter functionality described e.g. here (the Time Range filter is simply not an option when selecting which filter to depend on). But ideally, I would like to be able to set this filter extension for an entire dataset (or in some other, global fashion). Is this possible?

@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 9, 2023

There was a recent feature added where value filters can be dependent on time range but it is not released yet. Likely to come up with 3.0

@filpano
Copy link
Author

filpano commented Jun 9, 2023

Thanks for the quick response. I assume you are talking about #23319.

While this is a step in the right direction, I don't think this would allow me to be able to dynamically populate my partition filters using just this feature, so I'm probably out of luck for the foreseeable future (at least for a straightforward solution).

@pramodAmbekar
Copy link

Hi @filpano ,

Did you find the solution for this, I'm facing the same issue, My partition is on {text_field}/year/month.

Your help would be much appreciated.
Than you.

@rusackas
Copy link
Member

I'm not sure if this is still an issue in current versions of Superset (3.x). Dependent filters have come a long way, but I haven't tried this exact use case in recent memory. If it is still an issue, we can re-open this if it's a "bug" but I'd point you to GitHub Discussions (using an Ideas thread) if this is more of a feature request. Closing this for now since it's not an acute bug in 3.x or newer.

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

4 participants