2

I am trying to select from an array in Hive and I'm having trouble doing so.

The statement I am trying is as follows:

select * from table where ID = 'tennis' 

ID field is of type array

A sample of array data in the id field would look like id = ('tennis', 'soccer', 'football')

1
  • A sample of array data in the id field would look like id = ('tennis', 'soccer', 'football') Commented Sep 4, 2019 at 17:54

1 Answer 1

1

The array_contains function is probably what you need:

select * from table where array_contains(ID,'tennis')
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.