Splitting a Column of JSON Data and then Cross Apply

How to turn this:

image

To This:

image

I’d recommend writing a UDF f that returns an array of all the properties. Then use

SELECT *
from t, table(f(t.labels));

It would be easier if the data was already in a JSON array. For that situation, you can do something like

SELECT *
from t, table(json_to_array(t.column_with_json_array));

Relevant documentation:
https://docs.singlestore.com/managed-service/en/reference/sql-reference/data-manipulation-language-dml/table.html

https://docs.singlestore.com/managed-service/en/reference/sql-reference/json-functions/json_to_array.html

And sorry it took so long to reply! I overlooked your question.