I need to extract a set of IDs from a table using Hive. The table from which I am to extract the data is partitioned by date. What I need are distinct IDs that appear in the table eight days ago but are not in the table for dates that represent the last seven days. I have tried using a subquery:
SELECT DISTINCT id
FROM my_table
WHERE date = '2016-07-14'
AND id NOT IN (
SELECT DISTINCT id
FROM my_table
WHERE date BETWEEN '2016-07-15' AND '2016-07-21'
);
However, I am getting an error message containing Unsupported language features in query (entire error message is too long to post here). Since I cannot use this approach in Hive SQL, what are my options here?