Apache Spark SQL query to get organization hierarchy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 08:44 AM - edited 12-29-2024 08:46 AM
I'm currently diving deep into Spark SQL and its capabilities, and I'm facing an interesting challenge. I'm eager to learn how to write CTE recursive queries in Spark SQL, but after thorough research, it seems that Spark doesn't natively support recursive queries.
I've been exploring various methods and even attempted some implementations, but I've hit a roadblock – my CTE recursive queries aren't yielding the expected results.
If anyone out there has experience or insights into solving this puzzle, I'd greatly appreciate your guidance.
Consider the following organization hierarchy chart
If I pass David's EmployeeId to the query, then it should display the organization hierarchy as shown below
Perhaps there's a creative workaround or a different approach that I haven't considered yet?
Feel free to drop a comment. Thank you in advance for your support!