I have a table with column id_list in which there are a set of strings e.g. ["1","2","4","6"].
The original table is
+-------------------+
| id_list |
+-------------------+
| ["1","2","4","6"] |
|-------------------+
| ["1","2","4","6"] |
|-------------------+
| ["1","2","4","6"] |
|-------------------+
| ["1","2","4","6"] |
|-------------------+
| ["7"] |
|-------------------+
I created the following table by explode the id_list column:
SELECT id, id_list FROM data LATERAL VIEW explode(id_list) dummy AS id;
+-------------+-------------------+
| id | id_list |
+-------------+-------------------+
| 1 | ["1","2","4","6"] |
+-------------|-------------------+
| 2 | ["1","2","4","6"] |
+-------------|-------------------+
| 4 | ["1","2","4","6"] |
+-------------|-------------------+
| 6 | ["1","2","4","6"] |
+-------------|-------------------+
| 7 | ["7"] |
+-------------|-------------------+
I want to remove the id from the id_list to have a table like below:
+-------------+-------------------+
| id | id_list |
+-------------+-------------------+
| 1 | ["2","4","6"] |
+-------------|-------------------+
| 2 | ["1","4","6"] |
+-------------|-------------------+
| 4 | ["1","2","6"] |
+-------------|-------------------+
| 6 | ["1","2","4"] |
+-------------|-------------------+
| 7 | [] |
+-------------|-------------------+
How to do that without using UDF?