When I add a filter in dashboard , it required the filter field is set a proper special type , like ‘category’ . The special type is auto generated when first time table schema scan , or manually changed by Admin in Admin->Data Model.
But in our scenario , we open metabase to hundreds of business users and allow them ask question , build dashboard , but not assign them admin role . We have 1K+ tables in vertica DB , we can’t ask Admin to manually change the TYPE for each table one by one when some fields are not auto recognized as a ‘preper’ Type but biz user need add it as a filter .
Here is of our thought:
- Setup a cron to batch update metabase_field.special_type to type/Category for all none-assigned column , not sure if change this column is enough , and not sure if we change all field to Category type , will take any issue ?
- Similar solution , just call API to change tyep , instead of update DB directly.
Does anyone have any suggestion about this problem?
It is always recommended to use the API instead of manually editing the application database, when possible. If you are editing the database, then always make sure you have backups.
The best way to learn the API, is to just use Metabase while having your browser developer Network-tab open and looking at the request, and what data is being send/received.
Alternatively is the build your own version of Metabase, where you tell it to fingerprint the fields more specific to your dataset, but if that’s the only change you need, then it might not be worth it:
Thanks @flamber , Actually we tried both way today , build our own version with change name.clj , and use API to change type directly .
But I am not sure if too many fields are changed to Category type , is there any Negative impact ? Such as performance , slow down x-ray , or too many cache fields value in mysql ? I am not sure what else metabase will do in backend if a field type change to Category. I need this changes but meantime , I don’t want to slow down the metabase performance . Any comments will be appreciate .
@rickw The more category fields, the more scans will happen, but that’s probably not an issue. I have seen setups much bigger than yours, but it depends on your infrastructure of course.
I don’t think you’ll see a big performance impact from that change specifically - but the only way to know for sure is to test your setup.
Happy to hear that , will do more test . thank you @flamber