PySpark. Recursively iterate through parent-child table (self-joins) I am looking for a good solution for the following problem: