I have an Hive table made of user_id and item_id (id of items that have been purchased by the user). I want to get a list of all the users who purchased item 1 but not item
There are some collection functions in Hive `(See collection functions here : https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF ) which can use here.
You can use the array_contains(Array<T>, value)
function to check if item 1 is present and the size(Array<T>)
function to make sure the length is 1. If both conditions are satisfied, you will get the desired output.