Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Metabase/Clojure error: Unfreezable type: class org.postgresql.jdbc.PgArray

Anyone knows something about this error in Metabase (or a similar one in any Clojure program)?

Unfreezable type: class org.postgresql.jdbc.PgArray

It happens regularly, but not always, when I use a postgresql array type (i.e. TEXT[]) in a question => it probably depends on the exact data in the pgArray somehow, but I wasn't able to figure out how.

There is a workaround to get rid of it: retype/cast all pgArrays to TEXT (or VARCHAR). But I would really like to understand why this is happening. Thx for any insights.

like image 754
Joe Samanek Avatar asked May 11 '26 17:05

Joe Samanek


1 Answers

Metabase uses a library called Nippy:

https://github.com/metabase/metabase/blob/master/project.clj#L61

Nippy provides fast serialization of common types. The error "Unfreezable type":

https://github.com/ptaoussanis/nippy/blob/master/src/taoensso/nippy.clj#L720

occurs when Nippy comes across data of a type it doesn't know how to serialize. PgArray, as a bespoke Postgres array type, is evidently one of those.

Providing serialization guidance to Nippy is not hard. Maybe make an issue for the Metabase folks with your details asking if they can do this?

like image 134
Jonah Benton Avatar answered May 13 '26 14:05

Jonah Benton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!