I have a table which uses a
metadata column of type jsonb. I was pleased to see that metabase parses that field's keys and values automatically and that you can manipulate the datatype.
I want to use
metadata.some_id, one of the keys from the jsonb object, as a foreign key of
event_session.id. So I did this in the admin panel:
The problem is that
event_session.id is (and needs to remain) a uuid and metabase will only parse
metadata.some_id as text, making it impossible to actually use it as a foreign key because of a type mismatch.
I suppose can write a custom sql query and turn it into a model and use that model in my queries - is this the intended solution for a problem like this?
Unless I'm missing something, I see a couple possible solutions:
-- Allow me to change the datatype of values parsed from json objects to be uuid
-- Support some form of type casting in the notebook editor, maybe as a part of the custom expressions