Redshift Super Data type Querying

6.3k Views Asked by At

Redshift's new super data type uses partiql for querying. I have an array of data that is not nested eg: [0,1,2,3,4] What is the best way to query this data? All the documentation talks about nested arrays, but this is at the root level and there is no testing.

I have tried select supercolumnname[n] from tablewithsuper; and I am getting nulls, which isn't right.

1

There are 1 best solutions below

0
On

The best way (that I know right now) is to unnest the array:

CREATE TEMPORARY TABLE my_table (my_array SUPER);
INSERT INTO my_table VALUES (JSON_PARSE('[10001,10002,3333]'));
SELECT m FROM my_table as t, t.my_array as m;