Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I have an int column main_region and an int array column regions.
main_region
regions
Is there any way to do something like SELECT append(main_region, regions) ... without UDF?
SELECT append(main_region, regions) ...
Hive is very limited in terms of UDFs for array manipulation.
If it was a string array, you could have used concat_ws and split.
concat_ws
split
For the general case, I think explode and collect_list can be used, but it would be very inefficient.
explode
collect_list
Your best bet is to implement a one-line UDF...
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.