I'm not sure how to remove empty elements within Hive arrays. To give context,
I have a table name tbl1 with six columns (key_1, v_1, v_2, v_3, v_4, v_5). When I query below:
SELECT
key1,
array( nvl(v_1,""),
nvl(v_2,""),
nvl(v_3,""),
nvl(v_4,""),
nvl(v_4,""),
nvl(v_5,"")) v_array
FROM
tbl1;
This result produces:
key1, v_array
1, ["a","b","c","d",""]
2, ["a","b","c","",""]
3, ["a","b","","",""]
However I want my result to look like below:
key1, v_array
1, ["a","b","c","d"]
2, ["a","b","c"]
3, ["a","b"]