0

I have an int column main_region and an int array column regions.

Is there any way to do something like SELECT append(main_region, regions) ... without UDF?

1 Answer 1

1

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.

For the general case, I think explode and collect_list can be used, but it would be very inefficient.

Your best bet is to implement a one-line UDF...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.