Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a recursive self-join in Foundry Contour?

I have a dataset which represents objects in a hierarchy (there are no cycles). I want to analyse it in Contour and figure out for each object the list of top-level related objects.

Say, my object A depends on objects B and C. Object C in turn depends on objects D and E. Now I want to figure out what are the "final" or highest level dependencies of A, and I expect the result to be B, D and E.

like image 614
Aron Avatar asked Oct 19 '25 15:10

Aron


1 Answers

While in the SQL world dedicated constructors are available to perform hierarchical queries (look for CONNECT BY), the underpinning language behind Contour / Palantir Foundry overall (i.e. Apache Spark) has no automatic recursive construct.

So, whilst it is possible to perform recursive queries with custom functions, I strongly doubt it would be feasible to implement them in Contour.

like image 161
CheTesta Avatar answered Oct 21 '25 12:10

CheTesta