cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Parent Hierarchy Queries/ Path Function /Recursive CTE's

Phani1
Valued Contributor II

Problem Statement:

We have a scenario where we get the data from the source in the format of (in actual 20 Levels and number of fields are more than 4 but for ease of understanding let’s consider below)

The actual code involved 20 levels of 4-5 fields each and with 20 joins/CTE for getting outputs.

Question:

Power BI level handling, Path Function is great and can generate the | separated lineage but, while visualizing it needs the separate column creation

But it will be overkill for the render time,

Do we have any similar in-built functions/libraries in Databricks (SQL,Pyspark, Dataframes,pandas) ??

Could you please suggest the optimized approach for this problem statement? (Consider the performance)

Kindly find the example in attachment.

1 REPLY 1

daniel_sahal
Esteemed Contributor

I don't think that we have anything similar as a built-in function. You'll need to write some custom code to achieve that.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group