Question
Hierarchy in Hive
Hi, new to Hive and SQL. So please be patient.
I've got a dataset with 2 tables:
1. organisations - contains names of the organisations and an id
2. relationships - contains id of the organisations which organisation is it related to, ie a superior
i've got a query to show the immediate relationship next to each other:
SELECT sub.organisation_id, sub.organisation_name, sup.organisation_id, sup.organisation_name
FROM organisation sup
JOIN relationship
ON sup.organisation_id = relationship_id
JOIN organisation sub
ON organisation_id = relationship_orgidHow do I query this using Hive (or Impala) to display all the organisations in the ancestry? E.g.,
baby -> mother -> grandmother -> great-grandmother -> great-great-grandmother -> etc.

