问题
Let's suppose we have a table:
Owner | Pets
------------------------------
Jack | "dog, cat, crocodile"
Mary | "bear, pig"
I want to get as a result:
Owner | Pets
------------------------------
Jack | "dog"
Jack | "cat"
Jack | "crocodile"
Mary | "bear"
Mary | "pig"
I found some solutions to similar problems by googling, but Impala SQL does not offer any of these capabilities to apply the suggested solutions.
Any help would be greatly appreciated!
回答1:
The following works in Impala:
split_part(string source, string delimiter, bigint n)
You can find the documentation here:
https://www.cloudera.com/documentation/enterprise/5-9-x/topics/impala_string_functions.html
来源:https://stackoverflow.com/questions/37399187/comma-delimited-string-to-individual-rows-impala-sql