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

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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!