I am looking to explode a row into multiple rows based on a column[integer] value, I am trying to do this using presto
Below is an example
| id | count |
|---|---|
| 1 | 5 |
| 2 | 2 |
expected output
| id | count |
|---|---|
| 1 | 5 |
| 1 | 5 |
| 1 | 5 |
| 1 | 5 |
| 1 | 5 |
| 2 | 2 |
| 2 | 2 |
in the above example, id 1 has to be repeated 5 times and id 2 has to be repeated 2 times based on the count. Based on my experience, presto doesnt support recursive CTE.
Any help would be appreciated.
Thanks