metabase / metabase/metabase

DB Routing: Be able to Re-scan field values for a routed database

Open
#68,778 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.Auto triaged .Team/QueryingPlatform Administration/Metadata & Sync Type:New Feature
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

What problem will this feature request solve?
Having filter connected to a question using a routed database will potentially show outdated data since I, as an admin, is unable to manually re-scan the field values (as I am able to do using a regular database). If the underlying data related to a filter dropdown values is changed, the filter won't show the new values.
Since these values changes rarely I think it would be nice to be able to trigger it manually (in the same manner as for a none routed database).

Describe the solution you'd like.
Similiar to a unrouted database, I would like to be able to trigger a re-scan of field values for a routed database, if needed.

Image

How does this feature request impact you?
The only workaround I found so far is to access my database directly (outside of Metabase) and delete the related row/rows in metabase_fieldvalues, which I preferably would like to avoid since it is kind of sketchy.
Without workaround, my users are unable to filter on the "new" value.

Additional information
I have verified this locally by setting up two databases: "Tenant default", "Tenant Foo" which containts user and user group tables. When I use the db routing feature and changes a group name manually in the database, it is reflected in my Question but not in the filter. If I deleted the related row in metabase_fieldvalues, Metabase do a re-scan and everything works as expected (i.e. filter values are updated).
Similiarly, if I create a question which queries "Tenant Foo" directly (not via DB routing), I am able to refresh the field values by clicking "Re-scan fieldvalues", which updated the filter values.

Let me know if I need to clarify something :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported setup with “Tenant default” and “Tenant Foo,” a routed question, and a changed group name. Compare the routed filter with a question querying “Tenant Foo” directly, then use the existing “Re-scan fieldvalues” action as the behavioral reference. Done means routed databases offer a manual re-scan and the filter shows updated values without deleting rows from metabase_fieldvalues.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.