Any alternative to Postgres Unnest function?

Hi, I’m evaluating MemSQL to use in production and trying to simulate some queries that we have in current system based on Postgres. It has VERY rich type system so i’m trying

I have JSON array in the JSON field and trying to extract values from such field to recordset.
In PostgreSQL it is simple, but with MemSQL i can not find appropriate solution.
PostgreSQL:

select s.id, v 
from some_table s
cross join lateral unnest(s.json_field) v

Any solution how to do that? At least once for preparing table.

You can use the TABLE and JSON_TO_ARRAY builtins:

select s.id, v.table_col
from some_table s
join TABLE(JSON_TO_ARRAY(s.json_field)) v
1 Like