I am looking for a way to create an array from another array based on the values of the second array with value mapping.
E.g.
Table A has columns id, some_array
and I have some value mapping in mind, says, {'a': 1, 'b': 2, 'c': 3}
I want to do a select to get the array of mapping results from some_array
So, if A is
| id | some_array |
|:---|:-----------|
| 1 | ['a', 'b'] |
| 2 | ['a', 'c'] |
I need a query to generate following
| id | parsed_array |
|:---|:-----------|
| 1 | [1, 2] |
| 2 | [1, 3 |
How can I achieve this query?
Thanks!